コード例 #1
0
  @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;
  }
コード例 #2
0
 public static ToNativeConverter<IRubyObject, long[]> getInstance(int arrayFlags) {
   return ArrayFlags.isOut(arrayFlags) ? ArrayFlags.isIn(arrayFlags) ? INOUT : OUT : IN;
 }