Examples of defineAlias()


Examples of org.jruby.RubyClass.defineAlias()

        RubyClass cSSLSocket = mSSL.defineClassUnder("SSLSocket",runtime.getObject(),SSLSOCKET_ALLOCATOR);
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "io");
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "context");
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "sync_close");
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "hostname");
        cSSLSocket.defineAlias("to_io","io");
        cSSLSocket.defineAnnotatedMethods(SSLSocket.class);
    }

    public SSLSocket(Ruby runtime, RubyClass type) {
        super(runtime,type);
View Full Code Here

Examples of org.jruby.RubyModule.defineAlias()

        Ruby runtime = context.getRuntime();
        RubyModule module = context.getRubyClass();
  
        if (module == null) throw runtime.newTypeError("no class to make alias");
  
        module.defineAlias(newName, oldName);
        module.callMethod(context, "method_added", runtime.newSymbol(newName));
  
        return runtime.getNil();
    }
   
View Full Code Here

Examples of org.jruby.RubyModule.defineAlias()

    public Label interpret(InterpreterContext interp, IRubyObject self) {
        if (getMethodAddr() == MethAddr.DEFINE_ALIAS) {
            Operand[] args = getCallArgs(); // Guaranteed 2 args by parser

            RubyModule clazz = self instanceof RubyModule ? (RubyModule) self : self.getMetaClass();
            clazz.defineAlias((String) args[0].retrieve(interp).toString(), (String) args[1].retrieve(interp).toString());
        } else {
            super.interpret(interp, self);
        }
        return null;
    }
View Full Code Here

Examples of org.jruby.RubyModule.defineAlias()

        String newName = (newNameArg instanceof String) ?
            (String) newNameArg : newNameArg.toString();
        String oldName = (oldNameArg instanceof String) ?
            (String) oldNameArg : oldNameArg.toString();

        module.defineAlias(newName, oldName);
        module.callMethod(context, "method_added", runtime.newSymbol(newName));
  
        return runtime.getNil();
    }
   
View Full Code Here

Examples of org.jruby.RubyModule.defineAlias()

        String newNameString = getNewName().retrieve(context, self, currDynScope, temp).toString();
        String oldNameString = getOldName().retrieve(context, self, currDynScope, temp).toString();

        RubyModule module = (object instanceof RubyModule) ? (RubyModule) object : object.getMetaClass();
        module.defineAlias(newNameString, oldNameString);
       
        return null;
    }

    @Override
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.