1 29 package org.jruby.internal.runtime.methods; 30 31 import org.jruby.RubyModule; 32 import org.jruby.runtime.Block; 33 import org.jruby.runtime.ThreadContext; 34 import org.jruby.runtime.Visibility; 35 import org.jruby.runtime.builtin.IRubyObject; 36 37 41 public class UndefinedMethod extends DynamicMethod { 42 private static final UndefinedMethod instance = new UndefinedMethod(Visibility.PUBLIC); 43 44 48 private UndefinedMethod(Visibility visibility) { 49 super(null, visibility); 50 } 51 52 public void preMethod(ThreadContext context, RubyModule implementationClass, IRubyObject self, String name, IRubyObject[] args, boolean noSuper, Block block) { 53 } 55 56 public void postMethod(ThreadContext context) { 57 } 59 60 public IRubyObject internalCall(ThreadContext context, RubyModule klazz, IRubyObject self, String name, IRubyObject[] args, boolean noSuper, Block block) { 61 throw new UnsupportedOperationException (); 62 } 63 64 67 public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, boolean noSuper) { 68 return internalCall(context, klazz, self, name, args, noSuper, Block.NULL_BLOCK); 69 } 70 71 public boolean isUndefined() { 72 return true; 73 } 74 75 public DynamicMethod dup() { 77 return instance; 78 } 79 80 84 public static UndefinedMethod getInstance() { 85 return instance; 86 } 87 } 88 | Popular Tags |