Package org.jruby

Examples of org.jruby.RubyModule$Generation


     * method to call from the frame, and then invoke that on the
     * super class with the current self as the actual object
     * invoking.
     */
    public static IRubyObject invokeSuper(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) {
        RubyModule klazz = context.getFrameKlazz();

        RubyClass superClass = findImplementerIfNecessary(self.getMetaClass(), klazz).getSuperClass();
       
        if (superClass == null) {
            String name = context.getFrameName();
            return callMethodMissing(context, self, klazz.searchMethod(name), name, args, CallType.SUPER, block);
        }
        return invokeAs(context, superClass, self, context.getFrameName(), args, block);
    }
View Full Code Here


        }
        return invokeAs(context, superClass, self, context.getFrameName(), args, block);
    }
   
    public static IRubyObject invokeSuper(ThreadContext context, IRubyObject self, Block block) {
        RubyModule klazz = context.getFrameKlazz();

        RubyClass superClass = findImplementerIfNecessary(self.getMetaClass(), klazz).getSuperClass();
       
        if (superClass == null) {
            String name = context.getFrameName();
            return callMethodMissing(context, self, klazz.searchMethod(name), name, CallType.SUPER, block);
        }
        return invokeAs(context, superClass, self, context.getFrameName(), block);
    }
View Full Code Here

        }
        return invokeAs(context, superClass, self, context.getFrameName(), block);
    }
   
    public static IRubyObject invokeSuper(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) {
        RubyModule klazz = context.getFrameKlazz();

        RubyClass superClass = findImplementerIfNecessary(self.getMetaClass(), klazz).getSuperClass();
       
        if (superClass == null) {
            String name = context.getFrameName();
            return callMethodMissing(context, self, klazz.searchMethod(name), name, arg0, CallType.SUPER, block);
        }
        return invokeAs(context, superClass, self, context.getFrameName(), arg0, block);
    }
View Full Code Here

        }
        return invokeAs(context, superClass, self, context.getFrameName(), arg0, block);
    }
   
    public static IRubyObject invokeSuper(ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1, Block block) {
        RubyModule klazz = context.getFrameKlazz();

        RubyClass superClass = findImplementerIfNecessary(self.getMetaClass(), klazz).getSuperClass();
       
        if (superClass == null) {
            String name = context.getFrameName();
            return callMethodMissing(context, self, klazz.searchMethod(name), name, arg0, arg1, CallType.SUPER, block);
        }
        return invokeAs(context, superClass, self, context.getFrameName(), arg0, arg1, block);
    }
View Full Code Here

        }
        return invokeAs(context, superClass, self, context.getFrameName(), arg0, arg1, block);
    }
   
    public static IRubyObject invokeSuper(ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) {
        RubyModule klazz = context.getFrameKlazz();

        RubyClass superClass = findImplementerIfNecessary(self.getMetaClass(), klazz).getSuperClass();
       
        if (superClass == null) {
            String name = context.getFrameName();
            return callMethodMissing(context, self, klazz.searchMethod(name), name, arg0, arg1, arg2, CallType.SUPER, block);
        }
        return invokeAs(context, superClass, self, context.getFrameName(), arg0, arg1, arg2, block);
    }
View Full Code Here

        return (RubyArray) value;
    }
   
    public static IRubyObject fetchClassVariable(ThreadContext context, Ruby runtime,
            IRubyObject self, String name) {
        RubyModule rubyClass = ASTInterpreter.getClassVariableBase(context, runtime);
  
        if (rubyClass == null) rubyClass = self.getMetaClass();

        return rubyClass.getClassVar(name);
    }
View Full Code Here

        return rubyClass.getClassVar(name);
    }
   
    public static IRubyObject fastFetchClassVariable(ThreadContext context, Ruby runtime,
            IRubyObject self, String internedName) {
        RubyModule rubyClass = ASTInterpreter.getClassVariableBase(context, runtime);
  
        if (rubyClass == null) rubyClass = self.getMetaClass();

        return rubyClass.fastGetClassVar(internedName);
    }
View Full Code Here

        }
    }
   
    public static IRubyObject setClassVariable(ThreadContext context, Ruby runtime,
            IRubyObject self, String name, IRubyObject value) {
        RubyModule rubyClass = ASTInterpreter.getClassVariableBase(context, runtime);
  
        if (rubyClass == null) rubyClass = self.getMetaClass();

        rubyClass.setClassVar(name, value);
  
        return value;
    }
View Full Code Here

        return value;
    }
   
    public static IRubyObject fastSetClassVariable(ThreadContext context, Ruby runtime,
            IRubyObject self, String internedName, IRubyObject value) {
        RubyModule rubyClass = ASTInterpreter.getClassVariableBase(context, runtime);
  
        if (rubyClass == null) rubyClass = self.getMetaClass();

        rubyClass.fastSetClassVar(internedName, value);
  
        return value;
    }
View Full Code Here

        return value;
    }
   
    public static IRubyObject declareClassVariable(ThreadContext context, Ruby runtime, IRubyObject self, String name, IRubyObject value) {
        // FIXME: This isn't quite right; it shouldn't evaluate the value if it's going to throw the error
        RubyModule rubyClass = ASTInterpreter.getClassVariableBase(context, runtime);
  
        if (rubyClass == null) throw runtime.newTypeError("no class/module to define class variable");
       
        rubyClass.setClassVar(name, value);
  
        return value;
    }
View Full Code Here

TOP

Related Classes of org.jruby.RubyModule$Generation

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.