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
- 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, UNTRUST_F, 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()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(Ruby runtime) Create the RubyMethod class and add it to the Ruby runtime.curry(ThreadContext context, IRubyObject[] args) booleanThis override does not do a "checked" dispatch.intgetLine()hash(ThreadContext context) inthashCode()This override does not do "checked" dispatch since Object usually has #hash defined.private longinspect()rb_obj_inspect call-seq: obj.inspect => string Returns a string containing a human-readable representation of obj.private booleanprivate booleanisSerialMatch(DynamicMethod otherMethod) 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
getMethod, getMethodName, name, op_eql19, owner, super_methodMethods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, dig, dig1, dig2, eqlInternal, equalInternal, getNativeClassIndex, inspect, puts, specificEval, toRubyString, toStringMethods inherited from class org.jruby.RubyBasicObject
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, defaultToJava, display, dup, ensureInstanceVariablesSettable, eql, eql_p, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, infectBy, infectBy, initialize, initialize_copy, initialize19, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method, method_missing, method_missing19, method19, methods, methods, methods19, methodsImpl, nil_p, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_cmp, op_equal_19, op_match, op_match19, op_not, op_not_equal, op_not_match, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, rbInspect, recacheBuiltinMethods, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method, singleton_method_added, singleton_method_added19, singleton_method_removed, singleton_method_removed19, singleton_method_undefined, singleton_method_undefined19, singleton_methods, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted, tainted_p, testFrozen, testFrozen, to_a, to_a, to_s, toJava, trust, type, type_deprecated, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
-
Field Details
-
receiver
-
-
Constructor Details
-
RubyMethod
-
-
Method Details
-
createMethodClass
Create the RubyMethod class and add it to the Ruby runtime. -
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- See Also:
-
isMethodMissingMatch
-
isSerialMatch
-
hash
-
hashCode
public int hashCode()Description copied from class:RubyObjectThis override does not do "checked" dispatch since Object usually has #hash defined.- Overrides:
hashCodein classRubyObject- See Also:
-
hashCodeImpl
private long hashCodeImpl() -
rbClone
Description copied from interface:IRubyObjectRubyMethod clone.- Specified by:
rbClonein interfaceIRubyObject- Specified by:
rbClonein classAbstractRubyMethod- Returns:
- a cloned object
-
to_proc
Create a Proc object. -
unbind
-
inspect
Description copied from class:RubyBasicObjectrb_obj_inspect call-seq: obj.inspect => string Returns 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- Returns:
- String
-
receiver
-
source_location
- Overrides:
source_locationin classAbstractRubyMethod
-
getFilename
- Overrides:
getFilenamein classAbstractRubyMethod
-
getLine
public int getLine()- Overrides:
getLinein classAbstractRubyMethod
-
parameters
- Overrides:
parametersin classAbstractRubyMethod
-
curry
-
super_method
-
original_name
- Overrides:
original_namein classAbstractRubyMethod
-