IRubyObject object = self.callMethod(context, "__getobj__");
DynamicMethod method = ((RubyObject)object).getMetaClass().searchMethod(methodName);
if (method.getVisibility().isPrivate()) {
throw context.getRuntime().newNoMethodError("method `" + methodName + "' is private", methodName, context.getRuntime().getNil());
}
return method.call(context, object, object.getMetaClass(), methodName, newArgs, block);
}
@JRubyMethod(rest = true)
public static IRubyObject send(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) {
return ((RubyObject)self.callMethod(context, "__getobj__")).send(context, args, block);