Examples of DynamicMethod


Examples of org.jruby.internal.runtime.methods.DynamicMethod

        DynamicMethod m = createDynamicMethod((RubyModule) module);
        ((RubyModule) module).addMethod(methodName.asJavaString(), m);
        return context.getRuntime().getNil();
    }
    protected DynamicMethod createDynamicMethod(RubyModule module) {
        return new DynamicMethod(module, Visibility.PUBLIC, CallConfiguration.NO_FRAME_NO_SCOPE) {

            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) {
                arity.checkArity(context.getRuntime(), args);
                return invoke(context, args);
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

            }
        });
       
        RubyClass singleton = arrayJavaProxy.getSingletonClass();
       
        final DynamicMethod oldNew = singleton.searchMethod("new");
       
        singleton.addMethod("new", new ArrayNewMethod(singleton, Visibility.PUBLIC, oldNew));
       
        arrayJavaProxy.defineAnnotatedMethods(ArrayJavaProxy.class);
        arrayJavaProxy.includeModule(runtime.getEnumerable());
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

        return !method.isCallableFrom(caller, callType) && !name.equals("method_missing");
    }
   
    public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
            CallType callType, Block block) {
        DynamicMethod method = searchMethod(name);
        IRubyObject caller = context.getFrameSelf();
        if (shouldCallMethodMissing(method, name, caller, callType)) {
            return RuntimeHelpers.callMethodMissing(context, self, method, name, callType, block);
        }
        return method.call(context, self, this, name, block);
    }
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

        }
        return method.call(context, self, this, name, block);
    }
   
    public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name, Block block) {
        DynamicMethod method = searchMethod(name);
        if (shouldCallMethodMissing(method)) {
            return RuntimeHelpers.callMethodMissing(context, self, method, name, CallType.FUNCTIONAL, block);
        }
        return method.call(context, self, this, name, block);
    }
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

    }
   
    public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
            IRubyObject[] args, CallType callType, Block block) {
        assert args != null;
        DynamicMethod method = searchMethod(name);
        IRubyObject caller = context.getFrameSelf();
        if (shouldCallMethodMissing(method, name, caller, callType)) {
            return RuntimeHelpers.callMethodMissing(context, self, method, name, args, callType, block);
        }
        return method.call(context, self, this, name, args, block);
    }
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

    }
   
    public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name,
            IRubyObject[] args, Block block) {
        assert args != null;
        DynamicMethod method = searchMethod(name);
        if (shouldCallMethodMissing(method)) {
            return RuntimeHelpers.callMethodMissing(context, self, method, name, args, CallType.FUNCTIONAL, block);
        }
        return method.call(context, self, this, name, args, block);
    }
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

        return method.call(context, self, this, name, args, block);
    }
   
    public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
            IRubyObject arg, CallType callType, Block block) {
        DynamicMethod method = searchMethod(name);
        IRubyObject caller = context.getFrameSelf();
        if (shouldCallMethodMissing(method, name, caller, callType)) {
            return RuntimeHelpers.callMethodMissing(context, self, method, name, arg, callType, block);
        }
        return method.call(context, self, this, name, arg, block);
    }
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

        return method.call(context, self, this, name, arg, block);
    }
   
    public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name,
            IRubyObject arg, Block block) {
        DynamicMethod method = searchMethod(name);
        if (shouldCallMethodMissing(method)) {
            return RuntimeHelpers.callMethodMissing(context, self, method, name, arg, CallType.FUNCTIONAL, block);
        }
        return method.call(context, self, this, name, arg, block);
    }
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

        return method.call(context, self, this, name, arg, block);
    }
   
    public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
            IRubyObject arg0, IRubyObject arg1, CallType callType, Block block) {
        DynamicMethod method = searchMethod(name);
        IRubyObject caller = context.getFrameSelf();
        if (shouldCallMethodMissing(method, name, caller, callType)) {
            return RuntimeHelpers.callMethodMissing(context, self, method, name, arg0, arg1, callType, block);
        }
        return method.call(context, self, this, name, arg0, arg1, block);
    }
View Full Code Here

Examples of org.jruby.internal.runtime.methods.DynamicMethod

        return method.call(context, self, this, name, arg0, arg1, block);
    }
   
    public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name,
            IRubyObject arg0, IRubyObject arg1, Block block) {
        DynamicMethod method = searchMethod(name);
        if (shouldCallMethodMissing(method)) {
            return RuntimeHelpers.callMethodMissing(context, self, method, name, arg0, arg1, CallType.FUNCTIONAL, block);
        }
        return method.call(context, self, this, name, arg0, arg1, block);
    }
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.