static RubyException newNameError(IRubyObject recv, IRubyObject message, IRubyObject name, boolean privateCall) { final RubyClass klass = (RubyClass) recv; RubyNameError newError = (RubyNameError) klass.allocate(); newError.callInit(message, name, Block.NULL_BLOCK); newError.privateCall = privateCall; return newError; }
public static JZlibRubyGzipReader newInstance(IRubyObject recv, IRubyObject[] args) { RubyClass klass = (RubyClass) recv; JZlibRubyGzipReader result = (JZlibRubyGzipReader) klass.allocate(); result.callInit(args, Block.NULL_BLOCK); return result; }
@Override public IRubyObject allocate(Ruby runtime, RubyClass klass) { klass.reifyWithAncestors(); return klass.allocate(); } };
public static RubyException newNoMethodError(IRubyObject recv, IRubyObject message, IRubyObject name, IRubyObject args) { RubyClass klass = (RubyClass)recv; RubyException newError = (RubyException) klass.allocate(); newError.callInit(message, name, args, Block.NULL_BLOCK); return newError; }
@Deprecated public static IRubyObject new19(ThreadContext context, IRubyObject recv, IRubyObject[] args) { return ((RubyClass) recv).allocate().callMethod(context, "initialize", args); } }
public static RubyException newNoMethodError(IRubyObject recv, IRubyObject message, IRubyObject name, IRubyObject args, boolean privateCall) { RubyClass klass = (RubyClass)recv; RubyNoMethodError newError = (RubyNoMethodError) klass.allocate(); newError.callInit(message, name, args, Block.NULL_BLOCK); newError.privateCall = privateCall; return newError; }
public static IRubyObject wrap(final Ruby rubyRuntime, final OutputStream out) { final RubyClass rubyClass = getOrCreateOutputStreamWrapperClass(rubyRuntime); final IRubyObject wrapper = rubyClass.allocate(); ((RubyOutputStreamWrapper) wrapper).setOut(out); return wrapper; }
@JRubyMethod(name = "new", omit = true) public IRubyObject newInstance(ThreadContext context, IRubyObject arg0, Block block) { IRubyObject obj = allocate(); baseCallSites[CS_IDX_INITIALIZE].call(context, obj, obj, arg0, block); return obj; }
@JRubyMethod(name = "new", rest = true, omit = true) public IRubyObject newInstance(ThreadContext context, IRubyObject[] args, Block block) { IRubyObject obj = allocate(); baseCallSites[CS_IDX_INITIALIZE].call(context, obj, obj, args, block); return obj; }
@JRubyMethod(name = "new", meta = true) public static RubyGzipFile newInstance(IRubyObject recv, Block block) { RubyClass klass = (RubyClass) recv; RubyGzipFile result = (RubyGzipFile) klass.allocate(); result.callInit(IRubyObject.NULL_ARRAY, block); return result; }
/** rb_class_new_instance * */ @JRubyMethod(name = "new", omit = true) public IRubyObject newInstance(ThreadContext context, Block block) { IRubyObject obj = allocate(); baseCallSites[CS_IDX_INITIALIZE].call(context, obj, obj, block); return obj; }
@JRubyMethod(name = "new", omit = true) public IRubyObject newInstance(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) { IRubyObject obj = allocate(); baseCallSites[CS_IDX_INITIALIZE].call(context, obj, obj, arg0, arg1, arg2, block); return obj; }
@Override public Object unmarshalFrom(Ruby runtime, RubyClass type, UnmarshalStream unmarshalStream) throws IOException { IRubyObject result = type.allocate(); unmarshalStream.registerLinkTarget(result); unmarshalStream.defaultVariablesUnmarshal(result); return result; } };
public static IRubyObject wrap(final Ruby rubyRuntime, final OutputStream out) { final RubyClass rubyClass = getOrCreateOutputStreamWrapperClass(rubyRuntime); final IRubyObject wrapper = rubyClass.allocate(); ((RubyOutputStreamWrapper) wrapper).setOut(out); return wrapper; }
public static RubyRegexp newRegexpFromStr(Ruby runtime, RubyString s, int options) { RubyRegexp re = (RubyRegexp)runtime.getRegexp().allocate(); re.regexpInitializeString(s, RegexpOptions.fromJoniOptions(options)); return re; }
@JRubyMethod(meta = true) public static RubyDate _load(ThreadContext context, IRubyObject klass, IRubyObject str) { IRubyObject a = RubyMarshal.load(context, null, new IRubyObject[] { str }, null); RubyDate obj = (RubyDate) ((RubyClass) klass).allocate(); return obj.marshal_load(context, a); }
@JRubyMethod(name = "now", meta = true) public static RubyTime newInstance(ThreadContext context, IRubyObject recv) { RubyTime obj = (RubyTime) ((RubyClass) recv).allocate(); obj.getMetaClass().getBaseCallSite(RubyClass.CS_IDX_INITIALIZE).call(context, recv, obj); return obj; }
@JRubyMethod(name = "new", rest = true, meta = true) public static IRubyObject newInstance(IRubyObject recv, IRubyObject[] args, Block block) { IRubyObject obj = ((RubyClass)recv).allocate(); obj.callMethod(recv.getRuntime().getCurrentContext(), "initialize", args, block); return obj; }
@JRubyMethod(name = "new", rest = true, meta = true) public static IRubyObject newInstance(IRubyObject recv, IRubyObject[] args, Block block) { IRubyObject obj = ((RubyClass)recv).allocate(); obj.callMethod(recv.getRuntime().getCurrentContext(), "initialize", args, block); return obj; }
private IRubyObject userNewUnmarshal() throws IOException { String className = unmarshalObject(false).asJavaString(); RubyClass classInstance = findClass(className); IRubyObject result = classInstance.allocate(); registerLinkTarget(result); IRubyObject marshaled = unmarshalObject(); return classInstance.smartLoadNewUser(result, marshaled); }