@Override public synchronized IRubyObject shift(ThreadContext context, IRubyObject num) { IRubyObject result = super.shift(context, num); rehash(); return result; }
@Override public synchronized IRubyObject shift(ThreadContext context) { IRubyObject result = super.shift(context); if ( result != context.nil ) rehash(); return result; }
@Override public synchronized IRubyObject shift(ThreadContext context) { IRubyObject result = super.shift(context); rehash(); return result; }
@Override public synchronized IRubyObject shift(ThreadContext context) { IRubyObject result = super.shift(context); if ( result != context.nil ) rehash(); return result; }
@Override public synchronized IRubyObject shift(ThreadContext context, IRubyObject num) { IRubyObject result = super.shift(context, num); rehash(); return result; }
@Override public synchronized IRubyObject shift(ThreadContext context) { IRubyObject result = super.shift(context); rehash(); return result; }
@Override public synchronized IRubyObject shift(ThreadContext context, IRubyObject num) { IRubyObject result = super.shift(context, num); rehash(); return result; }
@Override public synchronized IRubyObject shift(ThreadContext context, IRubyObject num) { IRubyObject result = super.shift(context, num); rehash(); return result; }
private IRubyObject yieldInner(ThreadContext context, RubyArray array, Block blockArg) { if (array.isEmpty()) { throw context.runtime.newArgumentError("no receiver given"); } final IRubyObject self = array.shift(context); return site.call(context, self, self, array.toJavaArray(), blockArg); }
private IRubyObject yieldInner(ThreadContext context, RubyArray array, Block block) { if (array.isEmpty()) { throw context.runtime.newArgumentError("no receiver given"); } IRubyObject self = array.shift(context); return site.call(context, self, self, array.toJavaArray(), block); }
private IRubyObject yieldInner(ThreadContext context, RubyArray array, Block blockArg) { if (array.isEmpty()) { throw context.runtime.newArgumentError("no receiver given"); } final IRubyObject self = array.shift(context); return site.call(context, self, self, array.toJavaArray(), blockArg); }
private IRubyObject yieldInner(ThreadContext context, RubyArray array, Block block) { if (array.isEmpty()) { throw context.runtime.newArgumentError("no receiver given"); } IRubyObject self = array.shift(context); return site.call(context, self, self, array.toJavaArray(), block); }
@JRubyMethod(name = {"sprintf", "format"}, required = 1, rest = true, module = true, visibility = PRIVATE) public static IRubyObject sprintf(ThreadContext context, IRubyObject recv, IRubyObject[] args) { if (args.length == 0) { throw context.runtime.newArgumentError("sprintf must have at least one argument"); } RubyString str = RubyString.stringValue(args[0]); IRubyObject arg; if (args.length == 2 && args[1] instanceof RubyHash) { arg = args[1]; } else { RubyArray newArgs = RubyArray.newArrayMayCopy(context.runtime, args); newArgs.shift(context); arg = newArgs; } return str.op_format(context, arg); }
public IRubyObject call(ThreadContext ctx, IRubyObject[] largs, Block blk) { if (result.size() == size) result.shift(ctx); result.append(packEnumValues(ctx, largs)); if (result.size() == size) block.yield(ctx, result.aryDup()); return ctx.nil; } });
public IRubyObject call(ThreadContext ctx, IRubyObject[] largs, Block blk) { if (result.size() == size) result.shift(ctx); result.append(packEnumValues(ctx, largs)); if (result.size() == size) block.yield(ctx, result.aryDup()); return ctx.nil; } });
public IRubyObject create(Ruby runtime, org.yecht.Node n, Data.Str ds) { ThreadContext ctx = runtime.getCurrentContext(); IRubyObject obj = RubyString.newStringShared(runtime, ds.ptr.buffer, ds.ptr.start, ds.len); obj.callMethod(ctx, "tr!", new IRubyObject[]{runtime.newString("\n\t "), runtime.newString("")}); IRubyObject arr = obj.callMethod(ctx, "unpack", runtime.newString("m")); return ((RubyArray)arr).shift(ctx); } });
@JRubyMethod(name = {"sprintf", "format"}, required = 1, rest = true, module = true, visibility = PRIVATE) public static IRubyObject sprintf(ThreadContext context, IRubyObject recv, IRubyObject[] args) { if (args.length == 0) { throw context.runtime.newArgumentError("sprintf must have at least one argument"); } RubyString str = RubyString.stringValue(args[0]); IRubyObject arg; if (context.runtime.is1_9() && args.length == 2 && args[1] instanceof RubyHash) { arg = args[1]; } else { RubyArray newArgs = context.runtime.newArrayNoCopy(args); newArgs.shift(context); arg = newArgs; } return str.op_format(context, arg); }
@JRubyMethod(name = {"sprintf", "format"}, required = 1, rest = true, module = true, visibility = PRIVATE) public static IRubyObject sprintf(ThreadContext context, IRubyObject recv, IRubyObject[] args) { if (args.length == 0) { throw context.runtime.newArgumentError("sprintf must have at least one argument"); } RubyString str = RubyString.stringValue(args[0]); IRubyObject arg; if (context.runtime.is1_9() && args.length == 2 && args[1] instanceof RubyHash) { arg = args[1]; } else { RubyArray newArgs = context.runtime.newArrayNoCopy(args); newArgs.shift(context); arg = newArgs; } return str.op_format(context, arg); }
public IRubyObject call(ThreadContext ctx, IRubyObject[] largs, Block blk) { if (result.size() == size) result.shift(ctx); result.append(packEnumValues(runtime, largs)); if (result.size() == size) block.yield(ctx, result.aryDup()); return runtime.getNil(); } });
public IRubyObject call(ThreadContext ctx, IRubyObject[] largs, Block blk) { if (result.size() == size) result.shift(ctx); result.append(packEnumValues(runtime, largs)); if (result.size() == size) block.yield(ctx, result.aryDup()); return runtime.getNil(); } });