@Deprecated public static RubyProc newProc(Ruby runtime, Block block, Block.Type type, ISourcePosition sourcePosition) { RubyProc proc = new RubyProc(runtime, runtime.getProc(), type, sourcePosition); proc.setup(block); return proc; }
@Deprecated public static RubyProc newProc(Ruby runtime, Block block, Block.Type type, ISourcePosition sourcePosition) { RubyProc proc = new RubyProc(runtime, runtime.getProc(), type, sourcePosition); proc.setup(block); return proc; }
public static RubyProc newProc(Ruby runtime, Block block, Block.Type type) { RubyProc proc = new RubyProc(runtime, runtime.getProc(), type); proc.setup(block); return proc; }
public static RubyProc newProc(Ruby runtime, Block block, Block.Type type, String file, int line) { RubyProc proc = new RubyProc(runtime, runtime.getProc(), type, file, line); proc.setup(block); return proc; }
public static RubyProc newProc(Ruby runtime, Block block, Block.Type type) { RubyProc proc = new RubyProc(runtime, runtime.getProc(), type); proc.setup(block); return proc; }
public static RubyProc newProc(Ruby runtime, Block block, Block.Type type, String file, int line) { RubyProc proc = new RubyProc(runtime, runtime.getProc(), type, file, line); proc.setup(block); return proc; }
public static RubyProc newProc(Ruby runtime, Block block, Block.Type type, ISourcePosition sourcePosition) { RubyProc proc = new RubyProc(runtime, runtime.getProc(), type, sourcePosition); proc.setup(block); return proc; }
public static RubyProc newProc(Ruby runtime, Block block, Block.Type type, ISourcePosition sourcePosition) { RubyProc proc = new RubyProc(runtime, runtime.getProc(), type, sourcePosition); proc.setup(block); return proc; }
@JRubyMethod(compat = RUBY2_0) public IRubyObject size(ThreadContext context) { if (size != null) { if (context.runtime.getProc().isInstance(size)) { return ((RubyProc)size).call(context, NULL_ARRAY); } return size; } return context.nil; }
@JRubyMethod(compat = RUBY2_0) public IRubyObject size(ThreadContext context) { if (size != null) { if (context.runtime.getProc().isInstance(size)) { return ((RubyProc)size).call(context, NULL_ARRAY); } return size; } return context.nil; }
@JRubyMethod(name = "to_proc") public RubyProc to_proc(ThreadContext context) { IRubyObject newProc = getOrCreateRubyHashMap().callMethod("to_proc"); TypeConverter.checkType(context, newProc, context.runtime.getProc()); return (RubyProc) newProc; }
private static IRubyObject coerceProc(IRubyObject proc, Ruby runtime) throws RaiseException { proc = TypeConverter.convertToType(proc, runtime.getProc(), "to_proc", false); if (!(proc instanceof RubyProc)) { throw runtime.newTypeError("wrong argument type " + proc.getMetaClass().getName() + " (expected Proc)"); } return proc; }
@JRubyMethod(name = "to_proc") public RubyProc to_proc(ThreadContext context) { IRubyObject newProc = getOrCreateRubyHashMap().callMethod("to_proc"); TypeConverter.checkType(context, newProc, context.runtime.getProc()); return (RubyProc) newProc; }
private static IRubyObject coerceProc(IRubyObject proc, Ruby runtime) throws RaiseException { proc = TypeConverter.convertToType(proc, runtime.getProc(), "to_proc", false); if (!(proc instanceof RubyProc)) { throw runtime.newTypeError("wrong argument type " + proc.getMetaClass().getName() + " (expected Proc)"); } return proc; }
private static IRubyObject coerceProc(IRubyObject maybeProc, Ruby runtime) throws RaiseException { IRubyObject proc = TypeConverter.convertToType(maybeProc, runtime.getProc(), "to_proc", false); if (!(proc instanceof RubyProc)) { throw runtime.newTypeError(str(runtime, "wrong argument type ", types(runtime, maybeProc.getMetaClass()), " (expected Proc)")); } return proc; }
private static IRubyObject coerceProc(IRubyObject maybeProc, Ruby runtime) throws RaiseException { IRubyObject proc = TypeConverter.convertToType(maybeProc, runtime.getProc(), "to_proc", false); if (!(proc instanceof RubyProc)) { throw runtime.newTypeError(str(runtime, "wrong argument type ", types(runtime, maybeProc.getMetaClass()), " (expected Proc)")); } return proc; }
@JRubyMethod public static IRubyObject to_proc(final ThreadContext context, final IRubyObject self) { final Ruby runtime = context.runtime; final java.lang.Runnable runnable = unwrapIfJavaObject(self); final Block block = new Block(new RunBody(runtime, runnable)); return new RubyProc(runtime, runtime.getProc(), block, null, -1); }
@JRubyMethod public static IRubyObject to_proc(final ThreadContext context, final IRubyObject self) { final Ruby runtime = context.runtime; final java.lang.Runnable runnable = unwrapIfJavaObject(self); final Block block = new Block(new RunBody(runtime, runnable)); return new RubyProc(runtime, runtime.getProc(), block, null, -1); }
@JRubyMethod(name = "initialize", visibility = PRIVATE, compat = RUBY2_0) public IRubyObject initialize20(ThreadContext context, IRubyObject object, Block block) { Ruby runtime = context.runtime; RubySymbol each = runtime.newSymbol("each"); // check for size if ((object.isNil() || runtime.getProc().isInstance(object)) || runtime.getFloat().isInstance(object) && ((RubyFloat)object).getDoubleValue() == Float.POSITIVE_INFINITY) { // object is nil, a proc, or infinity; use it for size IRubyObject gen = context.runtime.getModule("JRuby").getClass("Generator").callMethod(context, "new", new IRubyObject[0], block); return initialize20(gen, each, NULL_ARRAY, object); } return initialize(object, each, NULL_ARRAY); }
@JRubyMethod(name = "initialize", visibility = PRIVATE, compat = RUBY2_0) public IRubyObject initialize20(ThreadContext context, IRubyObject object, Block block) { Ruby runtime = context.runtime; RubySymbol each = runtime.newSymbol("each"); // check for size if ((object.isNil() || runtime.getProc().isInstance(object)) || runtime.getFloat().isInstance(object) && ((RubyFloat)object).getDoubleValue() == Float.POSITIVE_INFINITY) { // object is nil, a proc, or infinity; use it for size IRubyObject gen = context.runtime.getModule("JRuby").getClass("Generator").callMethod(context, "new", new IRubyObject[0], block); return initialize20(gen, each, NULL_ARRAY, object); } return initialize(object, each, NULL_ARRAY); }