Top Description Fields Constructors Methods
org.jruby

public Class RubyUnboundMethod

extends AbstractRubyMethod
Class Inheritance
Annotations
@JRubyClass
name:UnboundMethod
parent:Method
Imports
org.jruby.anno.JRubyMethod, .JRubyClass, org.jruby.internal.runtime.methods.AliasMethod, .PartialDelegatingMethod, .ProcMethod, org.jruby.runtime.Arity, .Block, .ClassIndex, .ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.callsite.CacheEntry

An unbound method representation (e.g. when retrieving an instance method from a class - isn't bound to any instance).

Note

This was renamed from UnboundMethod.java

Author
jpetersen

Field Summary

Inherited from org.jruby.AbstractRubyMethod:
entryimplementationModulemethodmethodNameoriginModuleoriginNamesourceModule

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public RubyMethod
bind(ThreadContext context, IRubyObject aReceiver)

public IRubyObject
bind_call(ThreadContext context, IRubyObject[] args, Block block)

private CacheEntry
public static RubyClass
public RubyUnboundMethod
dup(ThreadContext
the thread context
context
)

Overrides default org.jruby.runtime.builtin.IRubyObject.dup.

RubyMethod dup.

public boolean
equals(Object
object to compare
other
)

Overrides org.jruby.AbstractRubyMethod.equals.

This override does not do a "checked" dispatch.

public RubyFixnum
hash(ThreadContext
the current thread context
context
)

Overrides org.jruby.RubyBasicObject.hash.

Will return the hash code of this object.

public int
hashCode()

Overrides org.jruby.RubyObject.hashCode.

This override does not do "checked" dispatch since Object usually has #hash defined.

public IRubyObject
inspect(ThreadContext context)

Overrides org.jruby.RubyBasicObject.inspect.

Overrides default org.jruby.runtime.builtin.IRubyObject.inspect.

Returns a string containing a human-readable representation of obj.

public static RubyUnboundMethod
newUnboundMethod(RubyModule implementationModule, String methodName, RubyModule originModule, String originName, CacheEntry entry)

public RubyBoolean
op_equal(ThreadContext context, IRubyObject other)

Overrides org.jruby.RubyBasicObject.op_equal.

Implements org.jruby.runtime.builtin.IRubyObject.op_equal.

rb_obj_equal Will by default use identity equality to compare objects.

public RubyUnboundMethod
public IRubyObject
Inherited from org.jruby.AbstractRubyMethod:
arityaritygetFilenamegetLinegetMethodgetMethodNameinspectnameop_eqlop_eql19original_nameownerparametersprivate_pprotected_ppublic_psource_locationsuper_method

Constructor Detail

RubyUnboundMethodback to summary
protected RubyUnboundMethod(Ruby runtime)

Method Detail

bindback to summary
public RubyMethod bind(ThreadContext context, IRubyObject aReceiver)
Annotations
@JRubyMethod
bind_callback to summary
public IRubyObject bind_call(ThreadContext context, IRubyObject[] args, Block block)
Annotations
@JRubyMethod
required:1
rest:true
checkArity:false
keywords:true
convertUnboundMethodToCallableEntryback to summary
private CacheEntry convertUnboundMethodToCallableEntry(ThreadContext context, RubyClass receiverClass)
defineUnboundMethodClassback to summary
public static RubyClass defineUnboundMethodClass(ThreadContext context, RubyClass Object)
dupback to summary
public RubyUnboundMethod dup(ThreadContext context)

Overrides default org.jruby.runtime.builtin.IRubyObject.dup.

Doc from org.jruby.runtime.builtin.IRubyObject.dup.

RubyMethod dup.

Parameters
context:ThreadContext

the thread context

Returns:RubyUnboundMethod

a dup-ed object

Annotations
@JRubyMethod
equalsback to summary
public boolean equals(Object other)

Overrides org.jruby.AbstractRubyMethod.equals.

Doc from org.jruby.RubyObject.equals.

This override does not do a "checked" dispatch.

Parameters
other:Object

Doc from org.jruby.RubyBasicObject.equals.

object to compare

Returns:boolean

Doc from org.jruby.RubyBasicObject.equals.

true if equals

Annotations
@Override
hashback to summary
public RubyFixnum hash(ThreadContext context)

Overrides org.jruby.RubyBasicObject.hash.

Doc from org.jruby.RubyBasicObject.hash.

Will return the hash code of this object. In comparison to MRI, this method will use the Java identity hash code instead of using rb_obj_id, since the usage of id in JRuby will incur the cost of some. ObjectSpace maintenance.

Parameters
context:ThreadContext

the current thread context

Returns:RubyFixnum

the hash value

Annotations
@JRubyMethod
hashCodeback to summary
public int hashCode()

Overrides org.jruby.RubyObject.hashCode.

Doc from org.jruby.RubyObject.hashCode.

This override does not do "checked" dispatch since Object usually has #hash defined.

Returns:int

the hash code

Annotations
@Override
inspectback to summary
public IRubyObject inspect(ThreadContext context)

Overrides org.jruby.RubyBasicObject.inspect.

Overrides default org.jruby.runtime.builtin.IRubyObject.inspect.

Doc from org.jruby.RubyBasicObject.inspect.

Returns a string containing a human-readable representation of obj. If not overridden, uses the to_s method to generate the string. [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]" Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"

Annotations
@JRubyMethod
name:inspect, to_s
@Override
newUnboundMethodback to summary
public static RubyUnboundMethod newUnboundMethod(RubyModule implementationModule, String methodName, RubyModule originModule, String originName, CacheEntry entry)
op_equalback to summary
public RubyBoolean op_equal(ThreadContext context, IRubyObject other)

Overrides org.jruby.RubyBasicObject.op_equal.

Implements org.jruby.runtime.builtin.IRubyObject.op_equal.

Doc from org.jruby.RubyBasicObject.op_equal.

rb_obj_equal Will by default use identity equality to compare objects. This follows the Ruby semantics. The name of this method doesn't follow the convention because hierarchy problems

Annotations
@Override
@JRubyMethod
name:==
rbCloneback to summary
public RubyUnboundMethod rbClone()

Implements abstract org.jruby.AbstractRubyMethod.rbClone.

Implements org.jruby.runtime.builtin.IRubyObject.rbClone.

Doc from org.jruby.runtime.builtin.IRubyObject.rbClone.

RubyMethod clone.

Returns:RubyUnboundMethod

a cloned object

Annotations
@JRubyMethod
name:clone
super_methodback to summary
public IRubyObject super_method(ThreadContext context)
Annotations
@JRubyMethod