public IRubyObject allocate(Ruby runtime, RubyClass klass) { return new RubyEnumerator(runtime, klass); } };
@Override public IRubyObject allocate(Ruby runtime, RubyClass klass) { return new RubyEnumerator(runtime, klass); } };
@Override public IRubyObject allocate(Ruby runtime, RubyClass klass) { return new RubyEnumerator(runtime, klass); } };
protected static IRubyObject newEnumerator(ThreadContext context, IRubyObject arg1, IRubyObject arg2) { Ruby runtime = context.runtime; return new RubyEnumerator(runtime, runtime.getEnumerator(), arg1, arg2, IRubyObject.NULL_ARRAY); }
public static IRubyObject enumeratorize(Ruby runtime, RubyClass type, IRubyObject object, String method, IRubyObject arg) { return new RubyEnumerator(runtime, type, object, runtime.fastNewSymbol(method), new IRubyObject[] {arg}); }
public static IRubyObject enumeratorize(Ruby runtime, RubyClass type, IRubyObject object, String method, IRubyObject[] args) { return new RubyEnumerator(runtime, type, object, runtime.fastNewSymbol(method), args); // TODO: make sure it's really safe to not to copy it }
protected static IRubyObject newEnumerator(ThreadContext context, IRubyObject arg1, IRubyObject arg2) { Ruby runtime = context.runtime; return new RubyEnumerator(runtime, runtime.getEnumerator(), arg1, arg2, IRubyObject.NULL_ARRAY); }
protected static IRubyObject newEnumerator(ThreadContext context, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3) { Ruby runtime = context.runtime; return new RubyEnumerator(runtime, runtime.getEnumerator(), arg1, arg2, new IRubyObject[]{arg3}); }
public static IRubyObject enumeratorizeWithSize(ThreadContext context, IRubyObject object, String method,IRubyObject arg, IRubyObject size) { Ruby runtime = context.runtime; return new RubyEnumerator(runtime, runtime.getEnumerator(), object, runtime.fastNewSymbol(method), new IRubyObject[] { arg }, size); }
/** * Transform object into an Enumerator with the given size */ public static IRubyObject enumeratorizeWithSize(ThreadContext context, final IRubyObject object, String method, IRubyObject[] args, SizeFn sizeFn) { Ruby runtime = context.runtime; return new RubyEnumerator(runtime, runtime.getEnumerator(), object, runtime.fastNewSymbol(method), args, sizeFn); }
protected static IRubyObject newEnumerator(ThreadContext context, IRubyObject arg) { Ruby runtime = context.runtime; return new RubyEnumerator(runtime, runtime.getEnumerator(), arg, runtime.newSymbol("each"), IRubyObject.NULL_ARRAY); }
/** * Transform object into an Enumerator with the given size */ public static IRubyObject enumeratorizeWithSize(ThreadContext context, final IRubyObject object, String method, IRubyObject[] args, SizeFn sizeFn) { Ruby runtime = context.runtime; return new RubyEnumerator(runtime, runtime.getEnumerator(), object, runtime.fastNewSymbol(method), args, sizeFn); }
protected static IRubyObject newEnumerator(ThreadContext context, IRubyObject arg) { Ruby runtime = context.runtime; return new RubyEnumerator(runtime, runtime.getEnumerator(), arg, runtime.newSymbol("each"), IRubyObject.NULL_ARRAY); }
public static IRubyObject enumeratorize(Ruby runtime, IRubyObject object, String method, IRubyObject... args) { return new RubyEnumerator(runtime, runtime.getEnumerator(), object, runtime.fastNewSymbol(method), args); // TODO: make sure it's really safe to not to copy it }
public static IRubyObject enumeratorize(Ruby runtime, IRubyObject object, String method, IRubyObject arg) { return new RubyEnumerator(runtime, runtime.getEnumerator(), object, runtime.fastNewSymbol(method), new IRubyObject[] {arg}); }
public static IRubyObject enumeratorize(Ruby runtime, IRubyObject object, String method, IRubyObject[] args) { return new RubyEnumerator(runtime, runtime.getEnumerator(), object, runtime.fastNewSymbol(method), args); // TODO: make sure it's really safe to not to copy it }
@JRubyMethod(rest = true) public IRubyObject each(ThreadContext context, IRubyObject[] args, Block block) { if (args.length == 0) { return each(context, block); } IRubyObject[] newArgs = new IRubyObject[methodArgs.length + args.length]; System.arraycopy(methodArgs, 0, newArgs, 0, methodArgs.length); System.arraycopy(args, 0, newArgs, methodArgs.length, args.length); return new RubyEnumerator(context.runtime, getType(), object, context.runtime.newSymbol("each"), newArgs); }
@JRubyMethod(rest = true) public IRubyObject each(ThreadContext context, IRubyObject[] args, Block block) { if (args.length == 0) { return each(context, block); } IRubyObject[] newArgs = new IRubyObject[methodArgs.length + args.length]; System.arraycopy(methodArgs, 0, newArgs, 0, methodArgs.length); System.arraycopy(args, 0, newArgs, methodArgs.length, args.length); return new RubyEnumerator(context.runtime, getType(), object, context.runtime.newSymbol("each"), newArgs); }
@JRubyMethod(rest = true) public IRubyObject each(ThreadContext context, IRubyObject[] args, Block block) { if (args.length == 0) { return each(context, block); } final int mlen = methodArgs.length; IRubyObject[] newArgs = new IRubyObject[mlen + args.length]; ArraySupport.copy(methodArgs, newArgs, 0, mlen); ArraySupport.copy(args, newArgs, mlen, args.length); return new RubyEnumerator(context.runtime, getType(), object, context.runtime.newSymbol("each"), newArgs); }
@JRubyMethod(rest = true) public IRubyObject each(ThreadContext context, IRubyObject[] args, Block block) { if (args.length == 0) { return each(context, block); } final int mlen = methodArgs.length; IRubyObject[] newArgs = new IRubyObject[mlen + args.length]; ArraySupport.copy(methodArgs, newArgs, 0, mlen); ArraySupport.copy(args, newArgs, mlen, args.length); return new RubyEnumerator(context.runtime, getType(), object, context.runtime.newSymbol("each"), newArgs); }