@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0) { if (javaVarargsCallables != null) return call(context, self, clazz, name, new IRubyObject[] {arg0}); JavaProxy proxy = castJavaProxy(self); JavaConstructor constructor = (JavaConstructor)findCallableArityOne(self, name, arg0); Object cArg0 = convertArg(arg0, constructor, 0); proxy.setObject(constructor.newInstanceDirect(cArg0)); return self; }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0) { if (javaVarargsCallables != null) return call(context, self, clazz, name, new IRubyObject[] {arg0}); JavaProxy proxy = castJavaProxy(self); JavaConstructor constructor = (JavaConstructor)findCallableArityOne(self, name, arg0); Object cArg0 = convertArg(arg0, constructor, 0); proxy.setObject(constructor.newInstanceDirect(cArg0)); return self; }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0) { if (javaVarargsCallables != null) return call(context, self, clazz, name, new IRubyObject[] {arg0}); JavaProxy proxy = castJavaProxy(self); JavaConstructor constructor = (JavaConstructor) findCallableArityOne(self, name, arg0); final Class<?>[] paramTypes = constructor.getParameterTypes(); Object cArg0 = arg0.toJava(paramTypes[0]); setAndCacheProxyObject(context, clazz, proxy, constructor.newInstanceDirect(context, cArg0)); return self; }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0) { if (javaVarargsCallables != null) return call(context, self, clazz, name, new IRubyObject[] {arg0}); JavaProxy proxy = castJavaProxy(self); JavaConstructor constructor = (JavaConstructor) findCallableArityOne(self, name, arg0); final Class<?>[] paramTypes = constructor.getParameterTypes(); Object cArg0 = arg0.toJava(paramTypes[0]); setAndCacheProxyObject(context, clazz, proxy, constructor.newInstanceDirect(context, cArg0)); return self; }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, Block block) { if (block.isGiven()) { JavaProxy proxy = castJavaProxy(self); RubyProc proc = RubyProc.newProc(context.runtime, block, block.type); JavaConstructor constructor = (JavaConstructor)findCallableArityOne(self, name, proc); Object cArg0 = convertArg(proc, constructor, 0); proxy.setObject(constructor.newInstanceDirect(cArg0)); return self; } else { return call(context, self, clazz, name); } }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, Block block) { if (block.isGiven()) { JavaProxy proxy = castJavaProxy(self); RubyProc proc = RubyProc.newProc(context.runtime, block, block.type); JavaConstructor constructor = (JavaConstructor)findCallableArityOne(self, name, proc); Object cArg0 = convertArg(proc, constructor, 0); proxy.setObject(constructor.newInstanceDirect(cArg0)); return self; } else { return call(context, self, clazz, name); } }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, Block block) { if (block.isGiven()) { JavaProxy proxy = castJavaProxy(self); RubyProc proc = RubyProc.newProc(context.runtime, block, block.type); JavaConstructor constructor = (JavaConstructor) findCallableArityOne(self, name, proc); final Class<?>[] paramTypes = constructor.getParameterTypes(); Object cArg0 = proc.toJava(paramTypes[0]); setAndCacheProxyObject(context, clazz, proxy, constructor.newInstanceDirect(context, cArg0)); return self; } return call(context, self, clazz, name); }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, Block block) { if (block.isGiven()) { JavaProxy proxy = castJavaProxy(self); RubyProc proc = RubyProc.newProc(context.runtime, block, block.type); JavaConstructor constructor = (JavaConstructor) findCallableArityOne(self, name, proc); final Class<?>[] paramTypes = constructor.getParameterTypes(); Object cArg0 = proc.toJava(paramTypes[0]); setAndCacheProxyObject(context, clazz, proxy, constructor.newInstanceDirect(context, cArg0)); return self; } return call(context, self, clazz, name); }