}
@Override
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, IRubyObject arg1, Block block) {
if (block.isGiven()) {
JavaProxy proxy = castJavaProxy(self);
RubyProc proc = RubyProc.newProc(context.runtime, block, block.type);
JavaMethod method = (JavaMethod)findCallableArityThree(self, name, arg0, arg1, proc);
Object cArg0 = convertArg(arg0, method, 0);
Object cArg1 = convertArg(arg1, method, 1);
Object cArg2 = convertArg(proc, method, 2);
return method.invokeDirect(context, proxy.getObject(), cArg0, cArg1, cArg2);
} else {
return call(context, self, clazz, name, arg0, arg1);
}
}