/** * 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; }
@JRubyMethod(name = "[]") public IRubyObject get(ThreadContext context, IRubyObject index) { return get(context, Util.int32Value(index)); }
/** * 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; }
/** * 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; }
@JRubyMethod(name = "[]") public IRubyObject get(ThreadContext context, IRubyObject index) { return get(context, Util.int32Value(index)); }
@JRubyMethod(name = { "to_a", "to_ary" }) public IRubyObject get(ThreadContext context) { IRubyObject[] elems = new IRubyObject[arrayType.length()]; for (int i = 0; i < elems.length; ++i) { elems[i] = get(context, i); } return RubyArray.newArrayNoCopy(context.runtime, elems); }
@JRubyMethod(name = "[]") public IRubyObject get(ThreadContext context, IRubyObject index) { return get(context, Util.int32Value(index)); }
@JRubyMethod(name = "[]") public IRubyObject get(ThreadContext context, IRubyObject index) { return get(context, Util.int32Value(index)); }
@JRubyMethod(name = { "to_a", "to_ary" }) public IRubyObject get(ThreadContext context) { IRubyObject[] elems = new IRubyObject[arrayType.length()]; for (int i = 0; i < elems.length; ++i) { elems[i] = get(context, i); } return RubyArray.newArrayNoCopy(context.runtime, elems); }
@JRubyMethod(name = { "to_a", "to_ary" }) public IRubyObject get(ThreadContext context) { IRubyObject[] elems = new IRubyObject[arrayType.length()]; for (int i = 0; i < elems.length; ++i) { elems[i] = get(context, i); } return RubyArray.newArrayMayCopy(context.runtime, elems); }
/** * 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; }
@JRubyMethod(name = { "to_a", "to_ary" }) public IRubyObject get(ThreadContext context) { IRubyObject[] elems = new IRubyObject[arrayType.length()]; for (int i = 0; i < elems.length; ++i) { elems[i] = get(context, i); } return RubyArray.newArrayMayCopy(context.runtime, elems); }