@JRubyMethod(name = "new", meta = true, required = 3, optional = 1) public static final IRubyObject newStructLayout(ThreadContext context, IRubyObject klass, IRubyObject[] args) { IRubyObject rbFields = args[0], size = args[1], alignment = args[2]; if (!(rbFields instanceof RubyArray)) { throw context.runtime.newTypeError(rbFields, context.runtime.getArray()); } List<IRubyObject> fields = Arrays.asList(((RubyArray) rbFields).toJavaArrayMaybeUnsafe()); return new StructLayout(context.runtime, (RubyClass) klass, fields, RubyNumeric.num2int(size), RubyNumeric.num2int(alignment)); }
@JRubyMethod(name = "new", meta = true, required = 3, optional = 1) public static final IRubyObject newStructLayout(ThreadContext context, IRubyObject klass, IRubyObject[] args) { IRubyObject rbFields = args[0], size = args[1], alignment = args[2]; if (!(rbFields instanceof RubyArray)) { throw context.runtime.newTypeError(rbFields, context.runtime.getArray()); } List<IRubyObject> fields = Arrays.asList(((RubyArray) rbFields).toJavaArrayMaybeUnsafe()); return new StructLayout(context.runtime, (RubyClass) klass, fields, RubyNumeric.num2int(size), RubyNumeric.num2int(alignment)); }
@JRubyMethod(name = "new", meta = true, required = 3, optional = 1) public static final IRubyObject newStructLayout(ThreadContext context, IRubyObject klass, IRubyObject[] args) { IRubyObject rbFields = args[0], size = args[1], alignment = args[2]; if (!(rbFields instanceof RubyArray)) { throw context.runtime.newTypeError(rbFields, context.runtime.getArray()); } List<IRubyObject> fields = Arrays.asList(((RubyArray) rbFields).toJavaArrayMaybeUnsafe()); return new StructLayout(context.runtime, (RubyClass) klass, fields, RubyNumeric.num2int(size), RubyNumeric.num2int(alignment)); }
@JRubyMethod(name = "new", meta = true, required = 3, optional = 1) public static final IRubyObject newStructLayout(ThreadContext context, IRubyObject klass, IRubyObject[] args) { IRubyObject rbFields = args[0], size = args[1], alignment = args[2]; if (!(rbFields instanceof RubyArray)) { throw context.runtime.newTypeError(rbFields, context.runtime.getArray()); } List<IRubyObject> fields = Arrays.asList(((RubyArray) rbFields).toJavaArrayMaybeUnsafe()); return new StructLayout(context.runtime, (RubyClass) klass, fields, RubyNumeric.num2int(size), RubyNumeric.num2int(alignment)); }