本文整理了Java中org.jruby.RubyHash.remove
方法的一些代码示例,展示了RubyHash.remove
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RubyHash.remove
方法的具体详情如下:
包路径:org.jruby.RubyHash
类名称:RubyHash
方法名:remove
暂无
代码示例来源:origin: org.jruby/jruby-complete
@Override
public boolean remove(RubyHash hash, Object o) {
return hash.remove(o) != null;
}
};
代码示例来源:origin: org.jruby/jruby-core
@Override
public boolean remove(RubyHash hash, Object o) {
return hash.remove(o) != null;
}
};
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public boolean remove(RubyHash hash, Object o) {
return hash.remove(o) != null;
}
};
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public boolean remove(RubyHash hash, Object o) {
return hash.remove(o) != null;
}
};
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public void visit(IRubyObject key, IRubyObject value) {
if (!block.yieldSpecific(context, key, value).isTrue()) {
modified[0] = true;
remove(key);
}
}
});
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public void visit(IRubyObject key, IRubyObject value) {
if (!block.yieldSpecific(context, key, value).isTrue()) {
modified[0] = true;
remove(key);
}
}
});
代码示例来源:origin: asciidoctor/asciidoctorj
@Override
public Object remove(Object key) {
if (!(key instanceof String)) {
return null;
}
Object convertedKey = convertJavaToRubyKey((String) key);
Object oldValue = rubyHash.get(convertedKey);
rubyHash.remove(convertedKey);
return convertRubyValue(oldValue);
}
代码示例来源:origin: io.airlift/rack
@Inject
public RackServlet(RackServletConfig config)
throws IOException
{
Preconditions.checkNotNull(config);
File rackScriptFile = new File(config.getRackConfigPath());
Preconditions.checkArgument(rackScriptFile.canRead(), "Could not find rack script specified by [" + config.getRackConfigPath()
+ "] and resolved to [" + rackScriptFile.getAbsolutePath() + "]");
runtime = JavaEmbedUtils.initialize(ImmutableList.of(rackScriptFile.getParentFile().getCanonicalPath()), createRuntimeConfig());
// don't inherit system settings for gems
RubyHash env = runtime.evalScriptlet("ENV").convertToHash();
env.remove("GEM_HOME");
env.remove("GEM_PATH");
InputStream stream = Resources.getResource("io/airlift/rack.rb").openStream();
try {
runtime.loadFile("rack.rb", stream, false);
}
finally {
stream.close();
}
IRubyObject builder = runtime.evalScriptlet("Airlift::RackServer::Builder.new");
rackApplication = adapter.callMethod(builder, "build", new IRubyObject[] {
javaToRuby(runtime, rackScriptFile.getCanonicalPath())
});
}
代码示例来源:origin: org.jruby/jruby-complete
@Override
public void visit(ThreadContext context, RubyHash self, IRubyObject key, IRubyObject value, int index, Block block) {
if (!block.yieldArray(context, context.runtime.newArray(key, value), null).isTrue()) {
modified = true;
self.remove(key);
}
}
}
代码示例来源:origin: org.asciidoctor/asciidoctorj
@Override
public Object remove(Object key) {
if (!(key instanceof String)) {
return null;
}
Object convertedKey = convertJavaToRubyKey((String) key);
Object oldValue = rubyHash.get(convertedKey);
rubyHash.remove(convertedKey);
return convertRubyValue(oldValue);
}
代码示例来源:origin: com.proofpoint.platform/rack-experimental
@Inject
public RackServlet(RackServletConfig config)
throws IOException
{
Preconditions.checkNotNull(config);
File rackScriptFile = new File(config.getRackConfigPath());
Preconditions.checkArgument(rackScriptFile.canRead(), "Could not find rack script specified by [" + config.getRackConfigPath()
+ "] and resolved to [" + rackScriptFile.getAbsolutePath() + "]");
runtime = JavaEmbedUtils.initialize(ImmutableList.of(rackScriptFile.getParentFile().getCanonicalPath()), createRuntimeConfig());
// don't inherit system settings for gems
RubyHash env = runtime.evalScriptlet("ENV").convertToHash();
env.remove("GEM_HOME");
env.remove("GEM_PATH");
InputStream stream = Resources.getResource("proofpoint/rack.rb").openStream();
try {
runtime.loadFile("rack.rb", stream, false);
}
finally {
stream.close();
}
IRubyObject builder = runtime.evalScriptlet("Proofpoint::RackServer::Builder.new");
rackApplication = adapter.callMethod(builder, "build", new IRubyObject[] {
javaToRuby(runtime, rackScriptFile.getCanonicalPath())
});
}
代码示例来源:origin: org.jruby/jruby-core
@Override
public void visit(ThreadContext context, RubyHash self, IRubyObject key, IRubyObject value, int index, Block block) {
if (!block.yieldArray(context, context.runtime.newArray(key, value), null).isTrue()) {
modified = true;
self.remove(key);
}
}
}
代码示例来源:origin: io.airlift/rack-experimental
@Inject
public RackServlet(RackServletConfig config)
throws IOException
{
Preconditions.checkNotNull(config);
File rackScriptFile = new File(config.getRackConfigPath());
Preconditions.checkArgument(rackScriptFile.canRead(), "Could not find rack script specified by [" + config.getRackConfigPath()
+ "] and resolved to [" + rackScriptFile.getAbsolutePath() + "]");
runtime = JavaEmbedUtils.initialize(ImmutableList.of(rackScriptFile.getParentFile().getCanonicalPath()), createRuntimeConfig());
// don't inherit system settings for gems
RubyHash env = runtime.evalScriptlet("ENV").convertToHash();
env.remove("GEM_HOME");
env.remove("GEM_PATH");
InputStream stream = Resources.getResource("io/airlift/rack.rb").openStream();
try {
runtime.loadFile("rack.rb", stream, false);
}
finally {
stream.close();
}
IRubyObject builder = runtime.evalScriptlet("Airlift::RackServer::Builder.new");
rackApplication = adapter.callMethod(builder, "build", new IRubyObject[] {
javaToRuby(runtime, rackScriptFile.getCanonicalPath())
});
}
代码示例来源:origin: asciidoctor/asciidoctorj
@Override
public Object remove(Object key) {
if (!(key instanceof String)) {
return null;
}
Object oldValue = get(key);
RubySymbol symbol = rubyHash.getRuntime().getSymbolTable().getSymbol((String) key);
rubyHash.remove(symbol);
return convertRubyValue(oldValue);
}
代码示例来源:origin: org.asciidoctor/asciidoctorj
@Override
public Object remove(Object key) {
if (!(key instanceof String)) {
return null;
}
Object oldValue = get(key);
RubySymbol symbol = rubyHash.getRuntime().getSymbolTable().getSymbol((String) key);
rubyHash.remove(symbol);
return convertRubyValue(oldValue);
}
内容来源于网络,如有侵权,请联系作者删除!