Package org.cx4a.rsense.ruby

Examples of org.cx4a.rsense.ruby.RubyModule.addMethod()


                                String oldName = Vertex.getStringOrSymbol(args[1]);
                                if (newName != null && oldName != null) {
                                    RubyModule module = (RubyModule) receiver;
                                    DynamicMethod method = module.getMethod(oldName);
                                    if (method instanceof Method)
                                        module.addMethod(newName, new AliasMethod(newName, (Method) method));
                                }
                            }
                        }
                    }
                    result.setCallNextMethod(callNextMethod);
View Full Code Here


    public Object visitAliasNode(AliasNode node) {
        RubyModule module = context.getFrameModule();
        DynamicMethod method = module.getMethod(node.getOldName());
        if (method instanceof Method)
            module.addMethod(node.getNewName(), new AliasMethod(node.getNewName(), (Method) method));
        return Vertex.EMPTY;
    }
   
    public Object visitAndNode(AndNode node) {
        Vertex vertex = createEmptyVertex(node);
View Full Code Here

            visibility = Visibility.PRIVATE;
        }

        Method oldMethod = (Method) klass.getMethod(name);
        Method newMethod = new DefaultMethod(cbase, name, bodyNode, argsNode, visibility, SourceLocation.of(node));
        klass.addMethod(name, newMethod);
       
        if (moduleFunction) {
            Method singletonMethod = new DefaultMethod(cbase, name, bodyNode, argsNode, visibility, SourceLocation.of(node));
            singletonMethod.setVisibility(Visibility.PUBLIC);
            klass.getSingletonClass().addMethod(name, singletonMethod);
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.