org.jruby.RubyHash.merge_bang()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(87)

本文整理了Java中org.jruby.RubyHash.merge_bang方法的一些代码示例,展示了RubyHash.merge_bang的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyHash.merge_bang方法的具体详情如下:
包路径:org.jruby.RubyHash
类名称:RubyHash
方法名:merge_bang

RubyHash.merge_bang介绍

[英]rb_hash_update
[中]rb_哈希_更新

代码示例

代码示例来源:origin: org.jruby/jruby-complete

protected void addImplSet(final ThreadContext context, final RubySet set) {
  // NOTE: MRI cheats - does not call Set#add thus we do not care ...
  hash.merge_bang(context, set.hash, Block.NULL_BLOCK);
}

代码示例来源:origin: org.jruby/jruby-core

protected void addImplSet(final ThreadContext context, final RubySet set) {
  // NOTE: MRI cheats - does not call Set#add thus we do not care ...
  hash.merge_bang(context, set.hash, Block.NULL_BLOCK);
}

代码示例来源:origin: org.jruby/jruby-core

@Deprecated
public RubyHash merge_bang19(ThreadContext context, IRubyObject other, Block block) {
  return merge_bang(context, other, block);
}

代码示例来源:origin: org.jruby/jruby-complete

@Deprecated
public RubyHash merge_bang19(ThreadContext context, IRubyObject other, Block block) {
  return merge_bang(context, other, block);
}

代码示例来源:origin: org.jruby/jruby-complete

/** rb_hash_merge
 *
 */
@JRubyMethod
public RubyHash merge(ThreadContext context, IRubyObject other, Block block) {
  return ((RubyHash)dup()).merge_bang(context, other, block);
}

代码示例来源:origin: org.jruby/jruby-core

/** rb_hash_merge
 *
 */
@JRubyMethod
public RubyHash merge(ThreadContext context, IRubyObject other, Block block) {
  return ((RubyHash)dup()).merge_bang(context, other, block);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/** rb_hash_merge
 *
 */
@JRubyMethod
public RubyHash merge(ThreadContext context, IRubyObject other, Block block) {
  return ((RubyHash)dup()).merge_bang(context, other, block);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/** rb_hash_merge
 *
 */
@JRubyMethod
public RubyHash merge(ThreadContext context, IRubyObject other, Block block) {
  return ((RubyHash)dup()).merge_bang(context, other, block);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@JRubyMethod(name = "system", required = 1, rest = true, module = true, visibility = PRIVATE, compat = CompatVersion.RUBY1_9)
public static IRubyObject system19(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
  Ruby runtime = context.runtime;
  if (args[0] instanceof RubyHash) {
    RubyHash env = (RubyHash) args[0].convertToHash();
    if (env != null) {
      runtime.getENV().merge_bang(context, env, Block.NULL_BLOCK);
    }
    // drop the first element for calling systemCommon()
    IRubyObject[] rest = new IRubyObject[args.length - 1];
    System.arraycopy(args, 1, rest, 0, args.length - 1);
    args = rest;
  }
  int resultCode = systemCommon(context, recv, args);
  switch (resultCode) {
    case 0: return runtime.getTrue();
    case 127: return runtime.getNil();
    default: return runtime.getFalse();
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@JRubyMethod(name = "system", required = 1, rest = true, module = true, visibility = PRIVATE, compat = CompatVersion.RUBY1_9)
public static IRubyObject system19(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
  Ruby runtime = context.runtime;
  if (args[0] instanceof RubyHash) {
    RubyHash env = (RubyHash) args[0].convertToHash();
    if (env != null) {
      runtime.getENV().merge_bang(context, env, Block.NULL_BLOCK);
    }
    // drop the first element for calling systemCommon()
    IRubyObject[] rest = new IRubyObject[args.length - 1];
    System.arraycopy(args, 1, rest, 0, args.length - 1);
    args = rest;
  }
  int resultCode = systemCommon(context, recv, args);
  switch (resultCode) {
    case 0: return runtime.getTrue();
    case 127: return runtime.getNil();
    default: return runtime.getFalse();
  }
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod(name = "<<")
public IRubyObject append(final ThreadContext context, IRubyObject item){
  if(!(item instanceof Enum)){
    throw context.runtime.newTypeError(item, context.runtime.getFFI().ffiModule.getClass("Enum"));
  }
  allEnums.append(item);
  if (!(item == null || item == context.nil)){
    IRubyObject tag = ((Enum)item).tag(context);
    if (tag != null && !tag.isNil())
      taggedEnums.fastASet(tag, item);
  }
  symbolMap.merge_bang(context, ((Enum)item).symbol_map(context), Block.NULL_BLOCK);
  return item;
}

代码示例来源:origin: org.jruby/jruby-core

@JRubyMethod(name = "<<")
public IRubyObject append(final ThreadContext context, IRubyObject item){
  if(!(item instanceof Enum)){
    throw context.runtime.newTypeError(item, context.runtime.getFFI().ffiModule.getClass("Enum"));
  }
  allEnums.append(item);
  if (!(item == null || item == context.nil)){
    IRubyObject tag = ((Enum)item).tag(context);
    if (tag != null && !tag.isNil())
      taggedEnums.fastASet(tag, item);
  }
  symbolMap.merge_bang(context, ((Enum)item).symbol_map(context), Block.NULL_BLOCK);
  return item;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

RubyHash envMap = env.convertToHash();
if (envMap != null) {
  runtime.getENV().merge_bang(context, envMap, Block.NULL_BLOCK);

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

RubyHash envMap = env.convertToHash();
if (envMap != null) {
  runtime.getENV().merge_bang(context, envMap, Block.NULL_BLOCK);

代码示例来源:origin: org.jruby/jruby-core

RubyHash envMap = env.convertToHash();
if (envMap != null) {
  runtime.getENV().merge_bang(context, envMap, Block.NULL_BLOCK);

代码示例来源:origin: org.jruby/jruby-complete

RubyHash envMap = env.convertToHash();
if (envMap != null) {
  runtime.getENV().merge_bang(context, envMap, Block.NULL_BLOCK);

代码示例来源:origin: org.jruby/jruby-complete

runtime.getENV().merge_bang(context, (RubyHash) args[0], Block.NULL_BLOCK);

代码示例来源:origin: org.jruby/jruby-core

runtime.getENV().merge_bang(context, (RubyHash) args[0], Block.NULL_BLOCK);

相关文章

微信公众号

最新文章

更多

RubyHash类方法