Package org.jruby.internal.runtime.methods

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


        callNormalMethodHook(containingClass, context, sym);
    }

    private static void addModuleMethod(RubyModule containingClass, String name, DynamicMethod method, ThreadContext context, RubySymbol sym) {
        containingClass.getSingletonClass().addMethod(name, new WrapperMethod(containingClass.getSingletonClass(), method, Visibility.PUBLIC));
        containingClass.callMethod(context, "singleton_method_added", sym);
    }
View Full Code Here


  
        containingClass.addMethod(name, newMethod);
  
        if (context.getCurrentVisibility() == Visibility.MODULE_FUNCTION) {
            containingClass.getSingletonClass().addMethod(name,
                    new WrapperMethod(containingClass.getSingletonClass(), newMethod, Visibility.PUBLIC));
           
            containingClass.callMethod(context, "singleton_method_added", runtime.fastNewSymbol(name));
        }
  
        // 'class << state.self' and 'class << obj' uses defn as opposed to defs
View Full Code Here

                clzz.addMethod(name, newMethod);
   
                if (context.getCurrentVisibility() == Visibility.MODULE_FUNCTION) {
                    clzz.getSingletonClass().addMethod(
                            name,
                            new WrapperMethod(clzz.getSingletonClass(), newMethod,
                                    Visibility.PUBLIC));
                    clzz.callMethod(context, "singleton_method_added", literals[val]);
                }
   
                if (clzz.isSingleton()) {
View Full Code Here

                containingClass.addMethod(mname, newMethod);
   
                if (context.getCurrentVisibility() == Visibility.MODULE_FUNCTION) {
                    RubyModule singleton = containingClass.getSingletonClass();
                    singleton.addMethod(mname, new WrapperMethod(singleton, newMethod, Visibility.PUBLIC));
                    containingClass.callMethod(context, "singleton_method_added", runtime.fastNewSymbol(mname));
                }
   
                // 'class << state.self' and 'class << obj' uses defn as opposed to defs
                if (containingClass.isSingleton()) {
View Full Code Here

        if (method.getVisibility() != visibility) {
            if (this == method.getImplementationClass()) {
                method.setVisibility(visibility);
            } else {
                // FIXME: Why was this using a FullFunctionCallbackMethod before that did callSuper?
                addMethod(name, new WrapperMethod(this, method, visibility));
            }
        }
    }
View Full Code Here

            for (int i = 0; i < args.length; i++) {
                String name = args[i].asJavaString().intern();
                DynamicMethod method = searchMethod(name);
                assert !method.isUndefined() : "undefined method '" + name + "'";
                getSingletonClass().addMethod(name, new WrapperMethod(getSingletonClass(), method, PUBLIC));
                callMethod(context, "singleton_method_added", context.getRuntime().fastNewSymbol(name));
            }
        }
        return this;
    }
View Full Code Here

  
        containingClass.addMethod(name, newMethod);
  
        if (context.getCurrentVisibility() == Visibility.MODULE_FUNCTION) {
            containingClass.getSingletonClass().addMethod(name,
                    new WrapperMethod(containingClass.getSingletonClass(), newMethod, Visibility.PUBLIC));
           
            containingClass.callMethod(context, "singleton_method_added", runtime.fastNewSymbol(name));
        }
  
        // 'class << state.self' and 'class << obj' uses defn as opposed to defs
View Full Code Here

        if (method.getVisibility() != visibility) {
            if (this == method.getImplementationClass()) {
                method.setVisibility(visibility);
            } else {
                // FIXME: Why was this using a FullFunctionCallbackMethod before that did callSuper?
                addMethod(name, new WrapperMethod(this, method, visibility));
            }

            invalidateCoreClasses();
            invalidateCacheDescendants();
        }
View Full Code Here

            setMethodVisibility(args, PRIVATE);

            for (int i = 0; i < args.length; i++) {
                String name = args[i].asJavaString().intern();
                DynamicMethod method = deepMethodSearch(name, runtime);
                getSingletonClass().addMethod(name, new WrapperMethod(getSingletonClass(), method, PUBLIC));
                callMethod(context, "singleton_method_added", context.getRuntime().fastNewSymbol(name));
            }
        }
        return this;
    }
View Full Code Here

        callNormalMethodHook(containingClass, context, sym);
    }

    private static void addModuleMethod(RubyModule containingClass, String name, DynamicMethod method, ThreadContext context, RubySymbol sym) {
        containingClass.getSingletonClass().addMethod(name, new WrapperMethod(containingClass.getSingletonClass(), method, Visibility.PUBLIC));
        containingClass.callMethod(context, "singleton_method_added", sym);
    }
View Full Code Here

TOP

Related Classes of org.jruby.internal.runtime.methods.WrapperMethod

Copyright © 2018 www.massapicom. 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.