java.lang.Object
org.jruby.internal.runtime.methods.DynamicMethod
org.jruby.internal.runtime.methods.UndefinedMethod
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jruby.internal.runtime.methods.DynamicMethod
DynamicMethod.NativeCall, DynamicMethod.Version -
Field Summary
FieldsFields inherited from class org.jruby.internal.runtime.methods.DynamicMethod
aliasCount, definedClass, flags, handle, implementationClass, name, protectedClass, serialNumber -
Method Summary
Modifier and TypeMethodDescriptioncall(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block) The one implementation of call, which throws an exception because UndefinedMethod can't be invoked.dup()A dummy implementation of dup that just returns the singleton instance.static UndefinedMethodRetrieve the singleton instance.UndefinedMethod is always visibility UNDEFINEDbooleanisCallableFrom(IRubyObject caller, CallType callType) UndefinedMethod is always visible because it's only used as a marker for missing or undef'ed methods.voidsetDefinedClass(RubyModule definedClass) Set the defining class for this method, as when restructuring hierarchy for prepend.voidsetImplementationClass(RubyModule implClass) Dummy override of setImplementationClass that does nothing.voidsetIsBuiltin(boolean isBuiltin) Force this method to be treated as a core built-in method if true, or as a normal non-core method otherwise.voidsetNotImplemented(boolean setNotImplemented) Set whether this method is "not implemented".voidsetVisibility(Visibility visibility) Dummy implementation of setVisibility that does nothing.Methods inherited from class org.jruby.internal.runtime.methods.DynamicMethod
adjustAliasCount, calculateProtectedClass, call, call, call, call, call, call, call, call, call, callRespondTo, getAliasCount, getArity, getCallConfig, getDefinedClass, getHandle, getImplementationClass, getInstanceVariableNames, getMethodData, getName, getProtectedClass, getRealMethod, getSerialNumber, getSignature, init, init, isBuiltin, isImplementedBy, isNative, isNotImplemented, isNull, isRefined, isUndefined, setCallConfig, setHandle, setRuby2Keywords
-
Field Details
-
INSTANCE
-
-
Method Details
-
call
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block) The one implementation of call, which throws an exception because UndefinedMethod can't be invoked.- Specified by:
callin classDynamicMethod- Parameters:
context- The thread context for the currently executing threadself- The 'self' or 'receiver' object to use for this callklazz- The Ruby class against which this method is bindingname- The incoming name used to invoke this methodargs- The argument list to this invocationblock- The block passed to this invocation- Returns:
- The result of the call
- Throws:
UnsupportedOperationException- See Also:
-
dup
A dummy implementation of dup that just returns the singleton instance.- Specified by:
dupin classDynamicMethod- Returns:
- The singleton instance
-
getInstance
Retrieve the singleton instance.- Returns:
- The singleton instance
-
setImplementationClass
Dummy override of setImplementationClass that does nothing.- Overrides:
setImplementationClassin classDynamicMethod- Parameters:
implClass- Ignored
-
setDefinedClass
Description copied from class:DynamicMethodSet the defining class for this method, as when restructuring hierarchy for prepend.- Overrides:
setDefinedClassin classDynamicMethod- Parameters:
definedClass- that method was defined in
-
getVisibility
UndefinedMethod is always visibility UNDEFINED- Overrides:
getVisibilityin classDynamicMethod- Returns:
- The visibility of this method
-
setVisibility
Dummy implementation of setVisibility that does nothing.- Overrides:
setVisibilityin classDynamicMethod- Parameters:
visibility- Ignored
-
setIsBuiltin
public void setIsBuiltin(boolean isBuiltin) Description copied from class:DynamicMethodForce this method to be treated as a core built-in method if true, or as a normal non-core method otherwise.- Overrides:
setIsBuiltinin classDynamicMethod- Parameters:
isBuiltin- true if this is a core built-in method, false otherwise
-
setNotImplemented
public void setNotImplemented(boolean setNotImplemented) Description copied from class:DynamicMethodSet whether this method is "not implemented".- Overrides:
setNotImplementedin classDynamicMethod- Parameters:
setNotImplemented- is this not implement or not
-
isCallableFrom
UndefinedMethod is always visible because it's only used as a marker for missing or undef'ed methods.- Overrides:
isCallableFromin classDynamicMethod- Parameters:
caller- The calling objectcallType- The type of call- Returns:
- true always
-