public static IRubyObject irToAry(ThreadContext context, IRubyObject value) { return value instanceof RubyArray ? value : RubyArray.aryToAry(context, value); }
public static IRubyObject irToAry(ThreadContext context, IRubyObject value) { return value instanceof RubyArray ? value : RubyArray.aryToAry(context, value); }
@Deprecated public static RubyArray aryToAry(IRubyObject obj) { return aryToAry(obj.getRuntime().getCurrentContext(), obj); }
@Deprecated public static RubyArray aryToAry(IRubyObject obj) { return aryToAry(obj.getRuntime().getCurrentContext(), obj); }
private void splice(final Ruby runtime, int beg, int len, IRubyObject rpl) { if (len < 0) throw runtime.newIndexError("negative length (" + len + ")"); if (beg < 0 && (beg += realLength) < 0) throw runtime.newIndexError("index " + (beg - realLength) + " out of array"); final RubyArray rplArr; final int rlen; if (rpl == null) { rplArr = null; rlen = 0; } else if (rpl.isNil()) { // 1.9 replaces with nil rplArr = newArray(runtime, rpl); rlen = 1; } else { rplArr = aryToAry(runtime.getCurrentContext(), rpl); rlen = rplArr.realLength; } splice(runtime, beg, len, rplArr, rlen); }
private void splice(final Ruby runtime, int beg, int len, IRubyObject rpl) { if (len < 0) throw runtime.newIndexError("negative length (" + len + ")"); if (beg < 0 && (beg += realLength) < 0) throw runtime.newIndexError("index " + (beg - realLength) + " out of array"); final RubyArray rplArr; final int rlen; if (rpl == null) { rplArr = null; rlen = 0; } else if (rpl.isNil()) { // 1.9 replaces with nil rplArr = newArray(runtime, rpl); rlen = 1; } else { rplArr = aryToAry(runtime.getCurrentContext(), rpl); rlen = rplArr.realLength; } splice(runtime, beg, len, rplArr, rlen); }
rlen = 1; } else { rplArr = aryToAry(rpl); rlen = rplArr.realLength;
rlen = 1; } else { rplArr = aryToAry(rpl); rlen = rplArr.realLength;