1 29 package org.jruby.internal.runtime.methods; 30 31 import org.jruby.Ruby; 32 import org.jruby.RubyModule; 33 import org.jruby.runtime.Block; 34 import org.jruby.runtime.ThreadContext; 35 import org.jruby.runtime.Visibility; 36 import org.jruby.runtime.builtin.IRubyObject; 37 38 42 public class WrapperMethod extends DynamicMethod { 43 private DynamicMethod method; 44 45 49 public WrapperMethod(RubyModule implementationClass, DynamicMethod method, Visibility visibility) { 50 super(implementationClass, visibility); 51 this.method = method; 52 } 53 54 public void preMethod(ThreadContext context, RubyModule klazz, IRubyObject self, String name, IRubyObject[] args, boolean noSuper, Block block) { 55 } 56 57 public void postMethod(ThreadContext context) { 58 } 59 60 public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, boolean noSuper, Block block) { 61 return method.call(context, self, klazz, name, args, noSuper, block); 62 } 63 64 67 public IRubyObject internalCall(ThreadContext context, RubyModule klazz, IRubyObject self, String name, IRubyObject[] args, boolean noSuper, Block block) { 68 assert false; 69 return null; 70 } 71 72 public DynamicMethod dup() { 73 return new WrapperMethod(getImplementationClass(), method, getVisibility()); 74 } 75 } 76 | Popular Tags |