@Override public Object interpret(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, Block block) { Object rubyContainer = container.retrieve(context, self, currDynScope, temp); if (!(rubyContainer instanceof RubyModule)) { throw context.runtime.newTypeError("no outer class/module"); } RubyModule newRubyClass = newClass(context, self, (RubyModule) rubyContainer, currDynScope, temp); newIRClassBody.getStaticScope().setModule(newRubyClass); return new InterpretedIRMethod(newIRClassBody, Visibility.PUBLIC, newRubyClass); }
@Override public Object interpret(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, Block block) { Object rubyContainer = container.retrieve(context, self, currDynScope, temp); if (!(rubyContainer instanceof RubyModule)) { throw context.runtime.newTypeError("no outer class/module"); } RubyModule newRubyClass = newClass(context, self, (RubyModule) rubyContainer, currDynScope, temp); newIRClassBody.getStaticScope().setModule(newRubyClass); return new InterpretedIRMethod(newIRClassBody, Visibility.PUBLIC, newRubyClass); }