Package org.jruby.internal.runtime.methods

Examples of org.jruby.internal.runtime.methods.DynamicMethod.call()


                return proxy;
            }

            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) {
                IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", arg0, arg1, arg2, block);
                if (needsCreate(proxy)) jcreateSite.call(context, proxy, proxy, arg0, arg1, arg2, block);
                return proxy;
            }

            @Override
View Full Code Here


                return proxy;
            }

            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args) {
                IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", args);
                if (needsCreate(proxy)) jcreateSite.call(context, proxy, proxy, args);
                return proxy;
            }

            @Override
View Full Code Here

                return proxy;
            }

            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name) {
                IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy");
                if (needsCreate(proxy)) jcreateSite.call(context, proxy, proxy);
                return proxy;
            }

            @Override
View Full Code Here

                return proxy;
            }

            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0) {
                IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", arg0);
                if (needsCreate(proxy)) jcreateSite.call(context, proxy, proxy, arg0);
                return proxy;
            }

            @Override
View Full Code Here

                return proxy;
            }

            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, IRubyObject arg1) {
                IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", arg0, arg1);
                if (needsCreate(proxy)) jcreateSite.call(context, proxy, proxy, arg0, arg1);
                return proxy;
            }

            @Override
View Full Code Here

                return proxy;
            }

            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) {
                IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", arg0, arg1, arg2);
                if (needsCreate(proxy)) jcreateSite.call(context, proxy, proxy, arg0, arg1, arg2);
                return proxy;
            }
        });
    }
View Full Code Here

            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);
View Full Code Here

                for (int i = nargs.length; --i >= 0; ) {
                    newArgs[i] = JavaUtil.convertJavaToUsableRubyObject(runtime, nargs[i]);
                }
               
                if (v < 0 || v == (newArgs.length)) {
                    return method.call(runtime.getCurrentContext(), self, self.getMetaClass(), name, newArgs).toJava(m.getReturnType());
                } else if (m.hasSuperImplementation()) {
                    RubyClass superClass = self.getMetaClass().getSuperClass();
                    return RuntimeHelpers.invokeAs(runtime.getCurrentContext(), superClass, self, name, newArgs, Block.NULL_BLOCK).toJava(m.getReturnType());
                } else {
                    throw runtime.newArgumentError(newArgs.length, v);
View Full Code Here

                    newArgs[i] = JavaUtil.convertJavaToUsableRubyObject(runtime, nargs[i]);
                }

                IRubyObject result = null;
                if (v < 0 || v == (newArgs.length)) {
                    result = method.call(runtime.getCurrentContext(), self, self.getMetaClass(), name, newArgs);
                } else if (m.hasSuperImplementation()) {
                    RubyClass superClass = self.getMetaClass().getSuperClass();
                    result = RuntimeHelpers.invokeAs(runtime.getCurrentContext(), superClass, self, name, newArgs, Block.NULL_BLOCK);
                } else {
                    throw runtime.newArgumentError(newArgs.length, v);
View Full Code Here

                for (int i = nargs.length; --i >= 0; ) {
                    newArgs[i] = JavaUtil.convertJavaToUsableRubyObject(runtime, nargs[i]);
                }
               
                if (v < 0 || v == (newArgs.length)) {
                    return method.call(runtime.getCurrentContext(), self, self.getMetaClass(), name, newArgs).toJava(m.getReturnType());
                } else if (m.hasSuperImplementation()) {
                    RubyClass superClass = self.getMetaClass().getSuperClass();
                    return RuntimeHelpers.invokeAs(runtime.getCurrentContext(), superClass, self, name, newArgs, Block.NULL_BLOCK).toJava(m.getReturnType());
                } else {
                    throw runtime.newArgumentError(newArgs.length, v);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.