Package org.jruby
Class RubyMethod
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.AbstractRubyMethod
org.jruby.RubyMethod
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<IRubyObject>,InstanceVariables,InternalVariables,IRubyObject,CoreObjectType,DataType
The RubyMethod class represents a RubyMethod object.
You can get such a method by calling the "method" method of an object.
Note: This was renamed from Method.java
- Since:
- 0.2.3
- Author:
- jpetersen
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.DataNested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer -
Field Summary
FieldsFields inherited from class org.jruby.AbstractRubyMethod
entry, implementationModule, method, methodName, originModule, originName, sourceModuleFields inherited from class org.jruby.RubyObject
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATORFields inherited from class org.jruby.RubyBasicObject
ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, IS_OVERLAID_F, metaClass, NEVER, NIL_F, REFINED_MODULE_F, STAMP_OFFSET, TAINTED_F, UNDEF, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, USER9_F, USERA_F, VAR_TABLE_OFFSET, varTable, varTableStampFields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarity(ThreadContext context) Returns the number of arguments a method accepted.call(ThreadContext context, Block block) Call the method.call(ThreadContext context, IRubyObject[] args, Block block) call(ThreadContext context, IRubyObject arg, Block block) call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block) call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) static RubyClasscreateMethodClass(ThreadContext context, RubyClass Object) curry(ThreadContext context) curry(ThreadContext context, IRubyObject arg0) curry(ThreadContext context, IRubyObject[] args) Deprecated.dup(ThreadContext context) RubyMethod dup.booleanThis override does not do a "checked" dispatch.hash(ThreadContext context) Will return the hash code of this object.inthashCode()This override does not do "checked" dispatch since Object usually has #hash defined.inspect(ThreadContext context) Returns a string containing a human-readable representation of obj.static RubyMethodnewMethod(RubyModule implementationModule, String methodName, RubyModule originModule, String originName, CacheEntry entry, IRubyObject receiver) op_eql(ThreadContext context, IRubyObject other) op_eqq(ThreadContext context, IRubyObject other) rb_equal The Ruby "===" method is used by default in case/when statements.op_equal(ThreadContext context, IRubyObject other) rb_obj_equal Will by default use identity equality to compare objects.original_name(ThreadContext context) parameters(ThreadContext context) rbClone()RubyMethod clone.receiver(ThreadContext context) source_location(ThreadContext context) super_method(ThreadContext context) to_proc(ThreadContext context) Create a Proc object.unbind()Methods inherited from class org.jruby.AbstractRubyMethod
arity, getFilename, getLine, getMethod, getMethodName, inspect, name, op_eql19, owner, private_p, protected_p, public_p, super_methodMethods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, dig, dig1, dig2, eqlInternal, equalInternal, finishObjectClass, getNativeClassIndex, inspect, puts, specificEval, toRubyString, toStringMethods inherited from class org.jruby.RubyBasicObject
addFinalizer, addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, cloneSetup, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, display, dup, dupFinalizer, dupSetup, ensureInstanceVariablesSettable, eql, eql_p, eql_p, equal_p, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, finishBasicObjectClass, forEachInstanceVariable, forEachInstanceVariableName, freeze, frozen_p, getCurrentContext, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMarshalVariableList, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, initialize, initialize_copy, initialize_copy, inspect, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval, instance_exec, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, makeMetaClass, makeMetaClassBootstrap, method, method, method, method_missing, methods, methods, nil_p, nonFixnumHashCode, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_cmp, op_match, op_not, op_not_equal, op_not_match, private_methods, protected_methods, public_methods, rbClone, rbInspect, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method, singleton_method, singleton_method_added, singleton_method_removed, singleton_method_undefined, singleton_methods, singletonClass, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, to_a, to_s, to_s, toJava, trust, type, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnderMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jruby.runtime.builtin.IRubyObject
checkStringType19, marshalLiveVariables
-
Field Details
-
receiver
-
-
Constructor Details
-
RubyMethod
-
-
Method Details
-
createMethodClass
-
newMethod
public static RubyMethod newMethod(RubyModule implementationModule, String methodName, RubyModule originModule, String originName, CacheEntry entry, IRubyObject receiver) -
call
Call the method. -
call
-
call
-
call
public IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) -
call
-
arity
Returns the number of arguments a method accepted.- Overrides:
arityin classAbstractRubyMethod- Returns:
- the number of arguments of a method.
-
op_eql
- Overrides:
op_eqlin classAbstractRubyMethod
-
op_equal
Description copied from class:RubyBasicObjectrb_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- Specified by:
op_equalin interfaceIRubyObject- Overrides:
op_equalin classRubyBasicObject
-
op_eqq
Description copied from class:RubyObjectrb_equal The Ruby "===" method is used by default in case/when statements. The Object implementation first checks Java identity equality and then calls the "==" method too.- Specified by:
op_eqqin interfaceIRubyObject- Overrides:
op_eqqin classRubyObject
-
equals
Description copied from class:RubyObjectThis override does not do a "checked" dispatch.- Overrides:
equalsin classAbstractRubyMethod- Parameters:
other- object to compare- Returns:
- true if equals
- See Also:
-
hash
Description copied from class:RubyBasicObjectWill 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.- Overrides:
hashin classRubyBasicObject- Parameters:
context- the current thread context- Returns:
- the hash value
-
hashCode
public int hashCode()Description copied from class:RubyObjectThis override does not do "checked" dispatch since Object usually has #hash defined.- Overrides:
hashCodein classRubyObject- Returns:
- the hash code
- See Also:
-
rbClone
Description copied from interface:IRubyObjectRubyMethod clone.- Specified by:
rbClonein interfaceIRubyObject- Specified by:
rbClonein classAbstractRubyMethod- Returns:
- a cloned object
-
dup
Description copied from interface:IRubyObjectRubyMethod dup.- Parameters:
context- the thread context- Returns:
- a dup-ed object
-
to_proc
Create a Proc object. -
unbind
-
inspect
Description copied from class:RubyBasicObjectReturns a string containing a human-readable representation of obj. If not overridden, uses theto_smethod 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"- Specified by:
inspectin interfaceIRubyObject- Overrides:
inspectin classRubyBasicObject
-
receiver
-
source_location
- Overrides:
source_locationin classAbstractRubyMethod
-
parameters
- Overrides:
parametersin classAbstractRubyMethod
-
curry
-
curry
-
super_method
-
original_name
- Overrides:
original_namein classAbstractRubyMethod
-
getReceiver
-
curry
Deprecated.
-