Top Description Fields Constructors Methods
org.jruby.internal.runtime.methods

public final Class UndefinedMethod

extends DynamicMethod
Class Inheritance
Imports
org.jruby.RubyModule, org.jruby.runtime.Block, .CallType, .ThreadContext, .Visibility, org.jruby.runtime.builtin.IRubyObject

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

Modifier and TypeField and Description
public static final UndefinedMethod
Inherited from org.jruby.internal.runtime.methods.DynamicMethod:
aliasCountdefinedClassflagshandleimplementationClassnameprotectedClassserialNumber

Constructor Summary

AccessConstructor and Description
private
UndefinedMethod()

Constructor for the one UndefinedMethod instance.

Method Summary

Modifier and TypeMethod and Description
public IRubyObject
call(ThreadContext
The thread context for the currently executing thread
context
,
IRubyObject
The 'self' or 'receiver' object to use for this call
self
,
RubyModule
The Ruby class against which this method is binding
klazz
,
String
The incoming name used to invoke this method
name
,
IRubyObject[]
The argument list to this invocation
args
,
Block
The block passed to this invocation
block
)

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.call.

The one implementation of call, which throws an exception because UndefinedMethod can't be invoked.

public DynamicMethod

Returns:

The singleton instance
dup
()

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.dup.

A dummy implementation of dup that just returns the singleton instance.

public static UndefinedMethod

Returns:

The singleton instance
getInstance
()

Retrieve the singleton instance.

public Visibility
getVisibility()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getVisibility.

UndefinedMethod is always visibility UNDEFINED

public boolean

Returns:

true always
isCallableFrom
(IRubyObject
The calling object
caller
,
CallType
The type of call
callType
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.isCallableFrom.

UndefinedMethod is always visible because it's only used as a marker for missing or undef'ed methods.

public void
setDefinedClass(RubyModule
that method was defined in
definedClass
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setDefinedClass.

Set the defining class for this method, as when restructuring hierarchy for prepend.

public void
setImplementationClass(RubyModule
Ignored
implClass
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setImplementationClass.

Dummy override of setImplementationClass that does nothing.

public void
setIsBuiltin(boolean
true if this is a core built-in method, false otherwise
isBuiltin
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setIsBuiltin.

Force this method to be treated as a core built-in method if true, or as a normal non-core method otherwise.

public void
setNotImplemented(boolean
is this not implement or not
setNotImplemented
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setNotImplemented.

Set whether this method is "not implemented".

public void
setVisibility(Visibility
Ignored
visibility
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setVisibility.

Dummy implementation of setVisibility that does nothing.

Inherited from org.jruby.internal.runtime.methods.DynamicMethod:
adjustAliasCountcalculateProtectedClasscallcallcallcallcallcallcallcallcallcallRespondTogetAliasCountgetAritygetCallConfiggetDefinedClassgetHandlegetImplementationClassgetInstanceVariableNamesgetMethodDatagetNamegetProtectedClassgetRealMethodgetSerialNumbergetSignatureinitinitisBuiltinisImplementedByisNativeisNotImplementedisNullisRefinedisUndefinedsetCallConfigsetHandlesetRuby2Keywords

Field Detail

INSTANCEback to summary
public static final UndefinedMethod INSTANCE

Constructor Detail

UndefinedMethodback to summary
private UndefinedMethod()

Constructor for the one UndefinedMethod instance.

Method Detail

callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block)

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.call.

The one implementation of call, which throws an exception because UndefinedMethod can't be invoked.

Parameters
context:ThreadContext

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The thread context for the currently executing thread

self:IRubyObject

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The 'self' or 'receiver' object to use for this call

klazz:RubyModule

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The Ruby class against which this method is binding

name:String

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The incoming name used to invoke this method

args:IRubyObject[]

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The argument list to this invocation

block:Block

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The block passed to this invocation

Returns:IRubyObject

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The result of the call

See Also
DynamicMethod#call(ThreadContext, IRubyObject, RubyModule, String)
dupback to summary
public DynamicMethod dup()

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.dup.

A dummy implementation of dup that just returns the singleton instance.

Returns:DynamicMethod

The singleton instance

getInstanceback to summary
public static UndefinedMethod getInstance()

Retrieve the singleton instance.

Returns:UndefinedMethod

The singleton instance

getVisibilityback to summary
public Visibility getVisibility()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getVisibility.

UndefinedMethod is always visibility UNDEFINED

Returns:Visibility

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getVisibility.

The visibility of this method

isCallableFromback to summary
public boolean isCallableFrom(IRubyObject caller, CallType callType)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.isCallableFrom.

UndefinedMethod is always visible because it's only used as a marker for missing or undef'ed methods.

Parameters
caller:IRubyObject

The calling object

callType:CallType

The type of call

Returns:boolean

true always

Annotations
@Override
setDefinedClassback to summary
public void setDefinedClass(RubyModule definedClass)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setDefinedClass.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.setDefinedClass.

Set the defining class for this method, as when restructuring hierarchy for prepend.

Parameters
definedClass:RubyModule

that method was defined in

Annotations
@Override
setImplementationClassback to summary
public void setImplementationClass(RubyModule implClass)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setImplementationClass.

Dummy override of setImplementationClass that does nothing.

Parameters
implClass:RubyModule

Ignored

Annotations
@Override
setIsBuiltinback to summary
public void setIsBuiltin(boolean isBuiltin)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setIsBuiltin.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.setIsBuiltin.

Force this method to be treated as a core built-in method if true, or as a normal non-core method otherwise.

Parameters
isBuiltin:boolean

true if this is a core built-in method, false otherwise

Annotations
@Override
setNotImplementedback to summary
public void setNotImplemented(boolean setNotImplemented)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setNotImplemented.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.setNotImplemented.

Set whether this method is "not implemented".

Parameters
setNotImplemented:boolean

is this not implement or not

Annotations
@Override
setVisibilityback to summary
public void setVisibility(Visibility visibility)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setVisibility.

Dummy implementation of setVisibility that does nothing.

Parameters
visibility:Visibility

Ignored

Annotations
@Override