org.jruby
Class RubyProc
java.lang.Object
org.jruby.RubyObject
org.jruby.RubyProc
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, JumpTarget, InstanceVariables, InternalVariables, IRubyObject, CoreObjectType
public class RubyProc
- extends RubyObject
- implements JumpTarget
- Author:
- jpetersen
- See Also:
- Serialized Form
Fields inherited from class org.jruby.RubyObject |
ALL_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, metaClassName, NEVER, NIL_F, OBJECT_ALLOCATOR, TAINTED_F, UNDEF, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, VARIABLE_TABLE_DEFAULT_CAPACITY, VARIABLE_TABLE_EMPTY_TABLE, VARIABLE_TABLE_LOAD_FACTOR, VARIABLE_TABLE_MAXIMUM_CAPACITY, variableTable, variableTableSize, variableTableThreshold |
Method Summary |
RubyFixnum |
arity()
|
IRubyObject |
binding()
|
IRubyObject |
call(ThreadContext context,
IRubyObject[] args)
|
IRubyObject |
call(ThreadContext context,
IRubyObject[] args,
Block unusedBlock)
|
IRubyObject |
call(ThreadContext context,
IRubyObject[] args,
IRubyObject self,
Block unusedBlock)
|
static RubyClass |
createProcClass(Ruby runtime)
|
IRubyObject |
dup()
rb_obj_dup
This method should be overriden only by: Proc
Will allocate a new instance of the real class of this object,
and then initialize that copy. |
Block |
getBlock()
|
IRubyObject |
initialize(ThreadContext context,
Block procBlock)
|
static IRubyObject |
newInstance(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block)
Create a new instance of a Proc object. |
static RubyProc |
newProc(Ruby runtime,
Block.Type type)
|
static RubyProc |
newProc(Ruby runtime,
Block block,
Block.Type type)
|
IRubyObject |
op_equal(IRubyObject other)
|
IRubyObject |
rbClone()
rb_obj_clone
This method should be overriden only by: Proc, Method,
UnboundedMethod, Binding. |
RubyProc |
to_proc()
|
IRubyObject |
to_s()
rb_any_to_s
call-seq:
obj.to_s => string
Returns a string representing obj. |
Methods inherited from class org.jruby.RubyObject |
addFinalizer, anyToString, asJavaString, asString, attachToObjectSpace, callInit, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkFrozen, checkStringType, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToString, convertToType, copySpecialInstanceVariables, createObjectClass, dataGetStruct, dataWrapStruct, display, ensureInstanceVariablesSettable, eql_p, eql, eqlInternal, equal_p, equalInternal, equals, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFlag, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariableList, getInternalVariables, getJavaClass, getMetaClass, getNativeTypeIndex, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariableCount, getVariableList, getVariableMap, getVariableNameList, hash, hashCode, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, id, infectBy, initialize_copy, initialize, inspect, instance_eval, instance_exec, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isRubyVariable, isTaint, isTrue, kind_of_p, makeMetaClass, method, methods, nil_p, op_eqq, op_equal, op_match, private_methods, protected_methods, public_methods, puts, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respondsTo, send, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setTaint, singleton_methods, specificEval, syncVariables, taint, tainted_p, testFrozen, to_a, toString, type_deprecated, type, untaint, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableGetMap, variableTableGetMap, variableTableGetSize, variableTableGetTable, variableTableReadLocked, variableTableRehash, variableTableRemove, variableTableStore, variableTableSync |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
RubyProc
public RubyProc(Ruby runtime,
RubyClass rubyClass,
Block.Type type)
createProcClass
public static RubyClass createProcClass(Ruby runtime)
getBlock
public Block getBlock()
newProc
public static RubyProc newProc(Ruby runtime,
Block.Type type)
newProc
public static RubyProc newProc(Ruby runtime,
Block block,
Block.Type type)
newInstance
public static IRubyObject newInstance(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block)
- Create a new instance of a Proc object. We override this method (from RubyClass)
since we need to deal with special case of Proc.new with no arguments or block arg. In
this case, we need to check previous frame for a block to consume.
initialize
public IRubyObject initialize(ThreadContext context,
Block procBlock)
rbClone
public IRubyObject rbClone()
- Description copied from class:
RubyObject
- rb_obj_clone
This method should be overriden only by: Proc, Method,
UnboundedMethod, Binding. It will use the defined allocated of
the object, then clone the singleton class, taint the object,
call initCopy and then copy frozen state.
- Specified by:
rbClone
in interface IRubyObject
- Overrides:
rbClone
in class RubyObject
- Returns:
- IRubyObject
dup
public IRubyObject dup()
- Description copied from class:
RubyObject
- rb_obj_dup
This method should be overriden only by: Proc
Will allocate a new instance of the real class of this object,
and then initialize that copy. It's different from
RubyObject.rbClone()
in that it doesn't copy the singleton class.
- Specified by:
dup
in interface IRubyObject
- Overrides:
dup
in class RubyObject
- Returns:
op_equal
public IRubyObject op_equal(IRubyObject other)
to_s
public IRubyObject to_s()
- Description copied from class:
RubyObject
- rb_any_to_s
call-seq:
obj.to_s => string
Returns a string representing obj. The default
to_s
prints the object's class and an encoding of the
object id. As a special case, the top-level object that is the
initial execution context of Ruby programs returns ``main.''
- Overrides:
to_s
in class RubyObject
binding
public IRubyObject binding()
call
public IRubyObject call(ThreadContext context,
IRubyObject[] args)
call
public IRubyObject call(ThreadContext context,
IRubyObject[] args,
Block unusedBlock)
call
public IRubyObject call(ThreadContext context,
IRubyObject[] args,
IRubyObject self,
Block unusedBlock)
arity
public RubyFixnum arity()
to_proc
public RubyProc to_proc()
Copyright © 2002-2007 JRuby Team. All Rights Reserved.