本文整理了Java中org.jruby.Ruby.newLocalJumpErrorNoBlock
方法的一些代码示例,展示了Ruby.newLocalJumpErrorNoBlock
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.newLocalJumpErrorNoBlock
方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:newLocalJumpErrorNoBlock
暂无
代码示例来源:origin: org.jruby/jruby-complete
@JRubyMethod(visibility = PRIVATE)
public IRubyObject initialize(ThreadContext context, Block block) {
Ruby runtime = context.runtime;
if (!block.isGiven()) throw runtime.newLocalJumpErrorNoBlock();
proc = runtime.newProc(Block.Type.PROC, block);
return this;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = {"module_exec", "class_exec"})
public IRubyObject module_exec(ThreadContext context, Block block) {
if (block.isGiven()) {
return yieldUnder(context, this, IRubyObject.NULL_ARRAY, block);
} else {
throw context.runtime.newLocalJumpErrorNoBlock();
}
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = {"module_exec", "class_exec"}, rest = true)
public IRubyObject module_exec(ThreadContext context, IRubyObject[] args, Block block) {
if (block.isGiven()) {
return yieldUnder(context, this, args, block);
} else {
throw context.runtime.newLocalJumpErrorNoBlock();
}
}
代码示例来源:origin: org.jruby/jruby-core
@JRubyMethod(visibility = PRIVATE)
public IRubyObject initialize(ThreadContext context, Block block) {
Ruby runtime = context.runtime;
if (!block.isGiven()) throw runtime.newLocalJumpErrorNoBlock();
proc = runtime.newProc(Block.Type.PROC, block);
return this;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = {"module_exec", "class_exec"}, rest = true)
public IRubyObject module_exec(ThreadContext context, IRubyObject[] args, Block block) {
if (block.isGiven()) {
return yieldUnder(context, this, args, block);
} else {
throw context.runtime.newLocalJumpErrorNoBlock();
}
}
代码示例来源:origin: org.jruby/jruby-complete
/** rb_ary_each_index
*
*/
public IRubyObject eachIndex(ThreadContext context, Block block) {
Ruby runtime = context.runtime;
if (!block.isGiven()) {
throw runtime.newLocalJumpErrorNoBlock();
}
for (int i = 0; i < realLength; i++) {
block.yield(context, runtime.newFixnum(i));
}
return this;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
@JRubyMethod(visibility = PRIVATE)
public IRubyObject initialize(ThreadContext context, Block block) {
Ruby runtime = context.runtime;
if (!block.isGiven()) throw runtime.newLocalJumpErrorNoBlock();
proc = runtime.newProc(Block.Type.PROC, block);
return this;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
@JRubyMethod(visibility = PRIVATE)
public IRubyObject initialize(ThreadContext context, Block block) {
Ruby runtime = context.runtime;
if (!block.isGiven()) throw runtime.newLocalJumpErrorNoBlock();
proc = runtime.newProc(Block.Type.PROC, block);
return this;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
@JRubyMethod(name = {"module_exec", "class_exec"})
public IRubyObject module_exec(ThreadContext context, Block block) {
if (block.isGiven()) {
return yieldUnder(context, this, IRubyObject.NULL_ARRAY, block);
} else {
throw context.runtime.newLocalJumpErrorNoBlock();
}
}
代码示例来源:origin: org.jruby/jruby-core
/** rb_ary_each_index
*
*/
public IRubyObject eachIndex(ThreadContext context, Block block) {
Ruby runtime = context.runtime;
if (!block.isGiven()) {
throw runtime.newLocalJumpErrorNoBlock();
}
for (int i = 0; i < realLength; i++) {
block.yield(context, runtime.newFixnum(i));
}
return this;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/** rb_ary_each_index
*
*/
public IRubyObject eachIndex(ThreadContext context, Block block) {
Ruby runtime = context.runtime;
if (!block.isGiven()) {
throw runtime.newLocalJumpErrorNoBlock();
}
for (int i = 0; i < realLength; i++) {
block.yield(context, runtime.newFixnum(i));
}
return this;
}
代码示例来源:origin: org.jruby/jruby-complete
@JRubyMethod(name = {"module_exec", "class_exec"},
reads = {LASTLINE, BACKREF, VISIBILITY, BLOCK, SELF, METHODNAME, LINE, CLASS, FILENAME, SCOPE},
writes = {LASTLINE, BACKREF, VISIBILITY, BLOCK, SELF, METHODNAME, LINE, CLASS, FILENAME, SCOPE})
public IRubyObject module_exec(ThreadContext context, Block block) {
if (block.isGiven()) {
return yieldUnder(context, this, IRubyObject.NULL_ARRAY, block.cloneBlockAndFrame(), EvalType.MODULE_EVAL);
} else {
throw context.runtime.newLocalJumpErrorNoBlock();
}
}
代码示例来源:origin: org.jruby/jruby-complete
@JRubyMethod(name = {"module_exec", "class_exec"}, rest = true,
reads = {LASTLINE, BACKREF, VISIBILITY, BLOCK, SELF, METHODNAME, LINE, CLASS, FILENAME, SCOPE},
writes = {LASTLINE, BACKREF, VISIBILITY, BLOCK, SELF, METHODNAME, LINE, CLASS, FILENAME, SCOPE})
public IRubyObject module_exec(ThreadContext context, IRubyObject[] args, Block block) {
if (block.isGiven()) {
return yieldUnder(context, this, args, block.cloneBlockAndFrame(), EvalType.MODULE_EVAL);
} else {
throw context.runtime.newLocalJumpErrorNoBlock();
}
}
代码示例来源:origin: org.jruby/jruby-core
@JRubyMethod(name = {"module_exec", "class_exec"},
reads = {LASTLINE, BACKREF, VISIBILITY, BLOCK, SELF, METHODNAME, LINE, CLASS, FILENAME, SCOPE},
writes = {LASTLINE, BACKREF, VISIBILITY, BLOCK, SELF, METHODNAME, LINE, CLASS, FILENAME, SCOPE})
public IRubyObject module_exec(ThreadContext context, Block block) {
if (block.isGiven()) {
return yieldUnder(context, this, IRubyObject.NULL_ARRAY, block.cloneBlockAndFrame(), EvalType.MODULE_EVAL);
} else {
throw context.runtime.newLocalJumpErrorNoBlock();
}
}
代码示例来源:origin: org.jruby/jruby-core
@JRubyMethod(name = {"module_exec", "class_exec"}, rest = true,
reads = {LASTLINE, BACKREF, VISIBILITY, BLOCK, SELF, METHODNAME, LINE, CLASS, FILENAME, SCOPE},
writes = {LASTLINE, BACKREF, VISIBILITY, BLOCK, SELF, METHODNAME, LINE, CLASS, FILENAME, SCOPE})
public IRubyObject module_exec(ThreadContext context, IRubyObject[] args, Block block) {
if (block.isGiven()) {
return yieldUnder(context, this, args, block.cloneBlockAndFrame(), EvalType.MODULE_EVAL);
} else {
throw context.runtime.newLocalJumpErrorNoBlock();
}
}
代码示例来源:origin: org.jruby/jruby-complete
/** rb_ary_collect_bang
*
*/
public RubyArray collectBang(ThreadContext context, Block block) {
if (!block.isGiven()) throw context.runtime.newLocalJumpErrorNoBlock();
modify();
for (int i = 0, len = realLength; i < len; i++) {
// Do not coarsen the "safe" check, since it will misinterpret AIOOBE from the yield
// See JRUBY-5434
store(i, block.yield(context, eltOk(i)));
}
return this;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/** rb_ary_collect_bang
*
*/
public RubyArray collectBang(ThreadContext context, Block block) {
if (!block.isGiven()) throw context.runtime.newLocalJumpErrorNoBlock();
modify();
for (int i = 0, len = realLength; i < len; i++) {
// Do not coarsen the "safe" check, since it will misinterpret AIOOBE from the yield
// See JRUBY-5434
store(i, block.yield(context, safeArrayRef(values, begin + i)));
}
return this;
}
代码示例来源:origin: org.jruby/jruby-core
/**
* Needed for Enumerable implementation
*/
@JRubyMethod(name = "each")
public IRubyObject each(ThreadContext context, Block block) {
if (!block.isGiven()) {
throw context.runtime.newLocalJumpErrorNoBlock();
}
for (int i = 0; i < arrayType.length(); ++i) {
block.yield(context, get(context, i));
}
return this;
}
代码示例来源:origin: org.jruby/jruby-core
/** rb_ary_collect_bang
*
*/
public RubyArray collectBang(ThreadContext context, Block block) {
if (!block.isGiven()) throw context.runtime.newLocalJumpErrorNoBlock();
modify();
for (int i = 0, len = realLength; i < len; i++) {
// Do not coarsen the "safe" check, since it will misinterpret AIOOBE from the yield
// See JRUBY-5434
store(i, block.yield(context, eltOk(i)));
}
return this;
}
代码示例来源:origin: org.jruby/jruby-complete
/**
* Needed for Enumerable implementation
*/
@JRubyMethod(name = "each")
public IRubyObject each(ThreadContext context, Block block) {
if (!block.isGiven()) {
throw context.runtime.newLocalJumpErrorNoBlock();
}
for (int i = 0; i < arrayType.length(); ++i) {
block.yield(context, get(context, i));
}
return this;
}
内容来源于网络,如有侵权,请联系作者删除!