All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jruby.javasupport.binding.SingletonMethodInvokerInstaller Maven / Gradle / Ivy

package org.jruby.javasupport.binding;

import org.jruby.RubyClass;
import org.jruby.RubyModule;
import org.jruby.java.invokers.SingletonMethodInvoker;

/**
* Created by headius on 2/26/15.
*/
public class SingletonMethodInvokerInstaller extends StaticMethodInvokerInstaller {

    final Object singleton;

    public SingletonMethodInvokerInstaller(String name, Object singleton) {
        super(name);
        this.singleton = singleton;
    }

    @Override void install(final RubyModule proxy) {
        // we don't check haveLocalMethod() here because it's not local and we know
        // that we always want to go ahead and install it
        final RubyClass singletonClass = proxy.getSingletonClass();
        defineMethods(singletonClass, new SingletonMethodInvoker(this.singleton, singletonClass, methods, name), false);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy