@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, IRubyObject arg1) { if (javaVarargsCallables != null) return call(context, self, clazz, name, new IRubyObject[] {arg0, arg1}); JavaProxy proxy = castJavaProxy(self); JavaMethod method = (JavaMethod)findCallableArityTwo(self, name, arg0, arg1); Object cArg0 = convertArg(arg0, method, 0); Object cArg1 = convertArg(arg1, method, 1); return method.invokeDirect(proxy.getObject(), cArg0, cArg1); }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, IRubyObject arg1) { if (javaVarargsCallables != null) return call(context, self, clazz, name, new IRubyObject[] {arg0, arg1}); JavaProxy proxy = castJavaProxy(self); JavaMethod method = (JavaMethod)findCallableArityTwo(self, name, arg0, arg1); Object cArg0 = convertArg(arg0, method, 0); Object cArg1 = convertArg(arg1, method, 1); return method.invokeDirect(proxy.getObject(), cArg0, cArg1); }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, IRubyObject arg1) { if (javaVarargsCallables != null) return call(context, self, clazz, name, new IRubyObject[] {arg0, arg1}); JavaProxy proxy = castJavaProxy(self); JavaMethod method = (JavaMethod) findCallableArityTwo(self, name, arg0, arg1); final Class<?>[] paramTypes = method.getParameterTypes(); Object cArg0 = arg0.toJava(paramTypes[0]); Object cArg1 = arg1.toJava(paramTypes[1]); return method.invokeDirect(context, proxy.getObject(), cArg0, cArg1); }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, IRubyObject arg1) { if (javaVarargsCallables != null) return call(context, self, clazz, name, new IRubyObject[] {arg0, arg1}); JavaProxy proxy = castJavaProxy(self); JavaMethod method = (JavaMethod) findCallableArityTwo(self, name, arg0, arg1); final Class<?>[] paramTypes = method.getParameterTypes(); Object cArg0 = arg0.toJava(paramTypes[0]); Object cArg1 = arg1.toJava(paramTypes[1]); return method.invokeDirect(context, proxy.getObject(), cArg0, cArg1); }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, Block block) { if (block.isGiven()) { JavaProxy proxy = castJavaProxy(self); RubyProc proc = RubyProc.newProc(context.runtime, block, block.type); JavaMethod method = (JavaMethod)findCallableArityTwo(self, name, arg0, proc); Object cArg0 = convertArg(arg0, method, 0); Object cArg1 = convertArg(proc, method, 1); return method.invokeDirect(proxy.getObject(), cArg0, cArg1); } else { return call(context, self, clazz, name, arg0); } }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, Block block) { if (block.isGiven()) { JavaProxy proxy = castJavaProxy(self); RubyProc proc = RubyProc.newProc(context.runtime, block, block.type); JavaMethod method = (JavaMethod)findCallableArityTwo(self, name, arg0, proc); Object cArg0 = convertArg(arg0, method, 0); Object cArg1 = convertArg(proc, method, 1); return method.invokeDirect(proxy.getObject(), cArg0, cArg1); } else { return call(context, self, clazz, name, arg0); } }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, Block block) { if (block.isGiven()) { JavaProxy proxy = castJavaProxy(self); RubyProc proc = RubyProc.newProc(context.runtime, block, block.type); JavaMethod method = (JavaMethod) findCallableArityTwo(self, name, arg0, proc); final Class<?>[] paramTypes = method.getParameterTypes(); Object cArg0 = arg0.toJava(paramTypes[0]); Object cArg1 = proc.toJava(paramTypes[1]); return method.invokeDirect(context, proxy.getObject(), cArg0, cArg1); } return call(context, self, clazz, name, arg0); }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, Block block) { if (block.isGiven()) { JavaProxy proxy = castJavaProxy(self); RubyProc proc = RubyProc.newProc(context.runtime, block, block.type); JavaMethod method = (JavaMethod) findCallableArityTwo(self, name, arg0, proc); final Class<?>[] paramTypes = method.getParameterTypes(); Object cArg0 = arg0.toJava(paramTypes[0]); Object cArg1 = proc.toJava(paramTypes[1]); return method.invokeDirect(context, proxy.getObject(), cArg0, cArg1); } return call(context, self, clazz, name, arg0); }