Package org.jruby

Examples of org.jruby.RubyModule.respondsTo()


    private IRubyObject userUnmarshal() throws IOException {
        String className = unmarshalObject().asJavaString();
        ByteList marshaled = unmarshalString();
        RubyModule classInstance = findClass(className);
        if (!classInstance.respondsTo("_load")) {
            throw runtime.newTypeError("class " + classInstance.getName() + " needs to have method `_load'");
        }
        RubyString data = RubyString.newString(getRuntime(), marshaled);
        if (ivarsWaiting) {
            defaultVariablesUnmarshal(data);
View Full Code Here


        final RubyModule jdbc = runtime.getModule("Jdbc");
        if ( jdbc != null ) { // Jdbc::MySQL
            final RubyModule constant = (RubyModule) jdbc.getConstantAt(constName);
            if ( constant != null ) { // ::Jdbc::MySQL.load_driver :
                if ( constant.respondsTo("load_driver") ) {
                    IRubyObject result = constant.callMethod("load_driver");
                    synchronized (loadedMap) {
                        loadedMap.put(constName, Boolean.TRUE);
                    }
                    return result;
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.