@Override public long[] toNative(IRubyObject value, ToNativeContext context) { RubyArray rbArray = value.convertToArray(); long[] arr = new long[rbArray.getLength()]; if (ArrayFlags.isIn(arrayFlags)) { for (int i = 0; i < arr.length; i++) { arr[i] = Util.longValue(rbArray.entry(i)); } } return arr; }
public static ToNativeConverter<IRubyObject, long[]> getInstance(int arrayFlags) { return ArrayFlags.isOut(arrayFlags) ? ArrayFlags.isIn(arrayFlags) ? INOUT : OUT : IN; }