org.jruby
Class RubyProc

java.lang.Object
  extended by org.jruby.RubyBasicObject
      extended by org.jruby.RubyObject
          extended by org.jruby.RubyProc
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<IRubyObject>, JumpTarget, InstanceVariables, InternalVariables, IRubyObject, CoreObjectType, DataType

public class RubyProc
extends RubyObject
implements JumpTarget, DataType

Author:
jpetersen
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.ObjectMethods
 
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.BasicObjectMethods, RubyBasicObject.Finalizer
 
Field Summary
 
Fields inherited from class org.jruby.RubyObject
OBJECT_ALLOCATOR
 
Fields inherited from class org.jruby.RubyBasicObject
ALL_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F
 
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
 
Constructor Summary
RubyProc(Ruby runtime, RubyClass rubyClass, Block.Type type)
           
 
Method Summary
 RubyFixnum arity()
           
 IRubyObject as(java.lang.Class asClass)
           
 IRubyObject binding()
           
 IRubyObject call(ThreadContext context, IRubyObject[] args)
           
 IRubyObject call(ThreadContext context, IRubyObject[] args, IRubyObject self, Block passedBlock)
           
 IRubyObject call19(ThreadContext context, IRubyObject[] args, Block block)
           
static RubyClass createProcClass(Ruby runtime)
           
 IRubyObject dup()
          rb_obj_dup This method should be overridden 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 overridden 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
attachToObjectSpace, callInit, checkFrozen, convertToType, createObjectClass, display, eql_p, eqlInternal, equal_p, equalInternal, equals, evalUnder, evalUnder, extend, freeze, frozen_p, getNativeTypeIndex, hash, hashCode, id_deprecated, id, initialize_copy, initialize, inspect, 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, kind_of_p, method, methods, nil_p, op_eqq, op_equal, op_match, private_methods, protected_methods, public_methods, puts, remove_instance_variable, respond_to_p, respond_to_p, send, send, send, send, send, singleton_methods, singleton_methods19, singletonMethods, specificEval, specificEval, specificEval, specificEval, specificEval, taint, tainted_p, to_a, to_java, toString, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable
 
Methods inherited from class org.jruby.RubyBasicObject
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkStringType, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataWrapStruct, ensureInstanceVariablesSettable, eql, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, getFlag, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hasInstanceVariable, hasInternalVariable, hasVariables, infectBy, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isTaint, isTrue, isUntrusted, makeMetaClass, op_not_equal, op_not, removeFinalizers, removeInstanceVariable, removeInternalVariable, respondsTo, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setTaint, setUntrusted, setVariable, syncVariables, taint, testFrozen, testFrozen, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableGetSize, variableTableRemove, variableTableStore, variableTableSync
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RubyProc

public RubyProc(Ruby runtime,
                RubyClass rubyClass,
                Block.Type type)
Method Detail

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 overridden 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 overridden 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)

call19

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

call

public IRubyObject call(ThreadContext context,
                        IRubyObject[] args,
                        IRubyObject self,
                        Block passedBlock)

arity

public RubyFixnum arity()

to_proc

public RubyProc to_proc()

as

public IRubyObject as(java.lang.Class asClass)
Overrides:
as in class RubyObject


Copyright © 2002-2007 JRuby Team. All Rights Reserved.