org.jruby.internal.runtime.methods
Class UndefinedMethod

java.lang.Object
  extended by org.jruby.internal.runtime.methods.DynamicMethod
      extended by org.jruby.internal.runtime.methods.UndefinedMethod

public class UndefinedMethod
extends DynamicMethod

This class represents a singleton type of method used as a marker for missing or "undef'ed" methods. Only one instance is ever created, and it can't be invoked.


Field Summary
static UndefinedMethod INSTANCE
           
 
Fields inherited from class org.jruby.internal.runtime.methods.DynamicMethod
callConfig, implementationClass, protectedClass, visibility
 
Method Summary
 IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, java.lang.String name, IRubyObject[] args, Block block)
          The one implementation of call, which throws an exception because UndefinedMethod can't be invoked.
 DynamicMethod dup()
          A dummy implementation of dup that just returns the singleton instance.
static UndefinedMethod getInstance()
          Retrieve the singleton instance.
 boolean isCallableFrom(IRubyObject caller, CallType callType)
          UndefinedMethod is always visible because it's only used as a marker for missing or undef'ed methods.
 void setCallConfig(CallConfiguration callConfig)
          Dummy implementation of setCallConfig that does nothing.
 void setImplementationClass(RubyModule implClass)
          Dummy override of setImplementationClass that does nothing.
 void setVisibility(Visibility visibility)
          Dummy implementation of setVisibility that does nothing.
 
Methods inherited from class org.jruby.internal.runtime.methods.DynamicMethod
calculateProtectedClass, call, call, call, call, call, call, call, call, call, getArity, getCallConfig, getImplementationClass, getProtectedClass, getRealMethod, getVisibility, handleRedo, handleReturn, init, isNative, isUndefined
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final UndefinedMethod INSTANCE
Method Detail

call

public IRubyObject call(ThreadContext context,
                        IRubyObject self,
                        RubyModule klazz,
                        java.lang.String name,
                        IRubyObject[] args,
                        Block block)
The one implementation of call, which throws an exception because UndefinedMethod can't be invoked.

Specified by:
call in class DynamicMethod
Parameters:
context - The thread context for the currently executing thread
self - The 'self' or 'receiver' object to use for this call
name - The incoming name used to invoke this method
args - The argument list to this invocation
block - The block passed to this invocation
Returns:
The result of the call
See Also:
DynamicMethod.call

dup

public DynamicMethod dup()
A dummy implementation of dup that just returns the singleton instance.

Specified by:
dup in class DynamicMethod
Returns:
The singleton instance

getInstance

public static UndefinedMethod getInstance()
Retrieve the singleton instance.

Returns:
The singleton instance

setImplementationClass

public void setImplementationClass(RubyModule implClass)
Dummy override of setImplementationClass that does nothing.

Overrides:
setImplementationClass in class DynamicMethod
Parameters:
implClass - Ignored

setVisibility

public void setVisibility(Visibility visibility)
Dummy implementation of setVisibility that does nothing.

Overrides:
setVisibility in class DynamicMethod
Parameters:
visibility - Ignored

setCallConfig

public void setCallConfig(CallConfiguration callConfig)
Dummy implementation of setCallConfig that does nothing.

Overrides:
setCallConfig in class DynamicMethod
Parameters:
callConfig - Ignored

isCallableFrom

public boolean isCallableFrom(IRubyObject caller,
                              CallType callType)
UndefinedMethod is always visible because it's only used as a marker for missing or undef'ed methods.

Overrides:
isCallableFrom in class DynamicMethod
Parameters:
caller - The calling object
callType - The type of call
Returns:
true always


Copyright © 2002-2007 JRuby Team. All Rights Reserved.