Top Fields Constructors Methods
org.jruby

public Class RubyProc

extends RubyObject
implements DataType
Class Inheritance
All Implemented Interfaces
org.jruby.runtime.marshal.DataType
Annotations
@JRubyClass
name:Proc
Imports
org.jruby.anno.JRubyClass, .JRubyMethod, org.jruby.ast.util.ArgsUtil, org.jruby.common.IRubyWarnings, org.jruby.ir.runtime.IRRuntimeHelpers, org.jruby.lexer.yacc.ISourcePosition, org.jruby.parser.StaticScope, org.jruby.runtime.Binding, .Block, .BlockBody, .ClassIndex, .Helpers, .IRBlockBody, .JavaSites, .MethodBlockBody, .Signature, .ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.marshal.DataType

Field Summary

Modifier and TypeField and Description
private Block
private String
private boolean
private int
private final Block.Type
Inherited from org.jruby.RubyObject:
IVAR_INSPECTING_OBJECT_ALLOCATOROBJECT_ALLOCATORREIFYING_OBJECT_ALLOCATOR

Constructor Summary

AccessConstructor and Description
protected
RubyProc(Ruby runtime, RubyClass rubyClass, Block.Type type)

protected
RubyProc(Ruby runtime, RubyClass rubyClass, Block.Type type, ISourcePosition sourcePosition)
Deprecated

protected
RubyProc(Ruby runtime, RubyClass rubyClass, Block.Type type, String file, int line)

public
RubyProc(Ruby runtime, RubyClass rubyClass, Block block, String file, int line)

Method Summary

Modifier and TypeMethod and Description
public RubyFixnum
arity()
Deprecated

public RubyFixnum
public IRubyObject
public final IRubyObject
call(ThreadContext context, IRubyObject[] args, Block blockCallArg)

public final IRubyObject
call(ThreadContext context, Block blockCallArg)

public final IRubyObject
call(ThreadContext context, IRubyObject arg0, Block blockCallArg)

public final IRubyObject
call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block blockCallArg)

public final IRubyObject
call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block blockCallArg)

public final IRubyObject
public final IRubyObject
call(ThreadContext context, IRubyObject... args)

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

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

private static IRubyObject[]
checkArityForLambda(ThreadContext context, Block.Type type, BlockBody blockBody, IRubyObject... args)

public static RubyClass
public IRubyObject
dup(ThreadContext
the thread context
context
)

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

RubyMethod dup.

public IRubyObject
dup()

Overrides org.jruby.RubyBasicObject.dup.

Implements org.jruby.runtime.builtin.IRubyObject.dup.

Deprecated

RubyMethod dup.

public Block
private boolean
private boolean
private boolean
public IRubyObject
public static IRubyObject
newInstance(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)

Create a new instance of a Proc object.

public static RubyProc
newProc(Ruby runtime, Block.Type type)
Deprecated

public static RubyProc
newProc(Ruby runtime, Block block, Block.Type type)

public static RubyProc
newProc(Ruby runtime, Block block, Block.Type type, ISourcePosition sourcePosition)
Deprecated

public static RubyProc
newProc(Ruby runtime, Block block, Block.Type type, String file, int line)

public static RubyProc
newProc(Ruby runtime, RubyClass clazz, Block block, Block.Type type, String file, int line)

public IRubyObject
op_equal(ThreadContext context, IRubyObject obj)

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 IRubyObject
public IRubyObject
private IRubyObject
parametersCommon(ThreadContext context, boolean isLambda)

public static IRubyObject[]
prepareArgs(ThreadContext context, Block.Type type, BlockBody blockBody, IRubyObject[] args)
Deprecated

For non-lambdas transforms the given arguments appropriately for the given arity (i.e. trimming to one arg for fixed arity of one, etc.)

Note

nothing should be calling this any more.

private RubyProc
public IRubyObject
public IRubyObject
public IRubyObject
public void
private void
setup(Ruby runtime, Block procBlock)

private static JavaSites.ProcSites
sites(ThreadContext context)

Hides org.jruby.RubyObject.sites.

Retrieve the call sites for this class.

public IRubyObject
public RubyProc
public IRubyObject
Inherited from org.jruby.RubyObject:
attachToObjectSpacecallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitconvertToTypedigdig1dig2eqlInternalequalInternalequalsfinishObjectClassgetNativeClassIndexhashCodeinspectop_eqqputsspecificEvaltoRubyStringtoString

Field Detail

blockback to summary
private Block block
fileback to summary
private String file
fromMethodback to summary
private boolean fromMethod
lineback to summary
private int line
typeback to summary
private final Block.Type type

Constructor Detail

RubyProcback to summary
protected RubyProc(Ruby runtime, RubyClass rubyClass, Block.Type type)
RubyProcback to summary
protected RubyProc(Ruby runtime, RubyClass rubyClass, Block.Type type, ISourcePosition sourcePosition)

Deprecated

Annotations
@Deprecated
RubyProcback to summary
protected RubyProc(Ruby runtime, RubyClass rubyClass, Block.Type type, String file, int line)
RubyProcback to summary
public RubyProc(Ruby runtime, RubyClass rubyClass, Block block, String file, int line)

Method Detail

arityback to summary
public RubyFixnum arity()

Deprecated

Annotations
@Deprecated
arityback to summary
public RubyFixnum arity(ThreadContext context)
Annotations
@JRubyMethod
name:arity
bindingback to summary
public IRubyObject binding()
Annotations
@JRubyMethod
name:binding
callback to summary
public final IRubyObject call(ThreadContext context, IRubyObject[] args, Block blockCallArg)
Annotations
@JRubyMethod
name:call, [], yield, ===
rest:true
omit:true
keywords:true
callback to summary
public final IRubyObject call(ThreadContext context, Block blockCallArg)
Annotations
@JRubyMethod
name:call, [], yield, ===
omit:true
keywords:true
callback to summary
public final IRubyObject call(ThreadContext context, IRubyObject arg0, Block blockCallArg)
Annotations
@JRubyMethod
name:call, [], yield, ===
omit:true
keywords:true
callback to summary
public final IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block blockCallArg)
Annotations
@JRubyMethod
name:call, [], yield, ===
omit:true
keywords:true
callback to summary
public final IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block blockCallArg)
Annotations
@JRubyMethod
name:call, [], yield, ===
omit:true
keywords:true
callback to summary
public final IRubyObject call(ThreadContext context, IRubyObject arg)
callback to summary
public final IRubyObject call(ThreadContext context, IRubyObject... args)
callback to summary
public final IRubyObject call(ThreadContext context, IRubyObject[] args, IRubyObject self, RubyModule sourceModule, Block passedBlock)
callback to summary
public final IRubyObject call(ThreadContext context, IRubyObject[] args, IRubyObject self, Block passedBlock)

Deprecated

Annotations
@Deprecated
checkArityForLambdaback to summary
private static IRubyObject[] checkArityForLambda(ThreadContext context, Block.Type type, BlockBody blockBody, IRubyObject... args)
createProcClassback to summary
public static RubyClass createProcClass(ThreadContext context, RubyClass Object)
dupback to summary
public IRubyObject 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:IRubyObject

a dup-ed object

Annotations
@JRubyMethod
name:dup
dupback to summary
public IRubyObject dup()

Overrides org.jruby.RubyBasicObject.dup.

Implements org.jruby.runtime.builtin.IRubyObject.dup.

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

Deprecated

RubyMethod dup.

Returns:IRubyObject

a dup-ed object

Annotations
@Deprecated
getBlockback to summary
public Block getBlock()
isFromMethodback to summary
private boolean isFromMethod()
isLambdaback to summary
private boolean isLambda()
isThreadback to summary
private boolean isThread()
lambda_pback to summary
public IRubyObject lambda_p(ThreadContext context)
Annotations
@JRubyMethod
name:lambda?
newInstanceback to summary
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.

Annotations
@JRubyMethod
name:new
rest:true
meta:true
newProcback to summary
public static RubyProc newProc(Ruby runtime, Block.Type type)

Deprecated

Annotations
@Deprecated
newProcback to summary
public static RubyProc newProc(Ruby runtime, Block block, Block.Type type)
newProcback to summary
public static RubyProc newProc(Ruby runtime, Block block, Block.Type type, ISourcePosition sourcePosition)

Deprecated

Annotations
@Deprecated
newProcback to summary
public static RubyProc newProc(Ruby runtime, Block block, Block.Type type, String file, int line)
newProcback to summary
public static RubyProc newProc(Ruby runtime, RubyClass clazz, Block block, Block.Type type, String file, int line)
op_equalback to summary
public IRubyObject op_equal(ThreadContext context, IRubyObject obj)

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
@JRubyMethod
name:==, eql?
parametersback to summary
public IRubyObject parameters(ThreadContext context)
Annotations
@JRubyMethod
parametersback to summary
public IRubyObject parameters(ThreadContext context, IRubyObject opts)
Annotations
@JRubyMethod
keywords:true
parametersCommonback to summary
private IRubyObject parametersCommon(ThreadContext context, boolean isLambda)
prepareArgsback to summary
public static IRubyObject[] prepareArgs(ThreadContext context, Block.Type type, BlockBody blockBody, IRubyObject[] args)

Deprecated

For non-lambdas transforms the given arguments appropriately for the given arity (i.e. trimming to one arg for fixed arity of one, etc.)

Note

nothing should be calling this any more.

Annotations
@Deprecated
procDupback to summary
private RubyProc procDup()
rbCloneback to summary
public IRubyObject rbClone(ThreadContext context)
Annotations
@JRubyMethod
name:clone
rbCloneback to summary
public IRubyObject rbClone()

Overrides org.jruby.RubyBasicObject.rbClone.

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

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

Deprecated

RubyMethod clone.

Returns:IRubyObject

a cloned object

Annotations
@Deprecated
ruby2_keywordsback to summary
public IRubyObject ruby2_keywords(ThreadContext context)
Annotations
@JRubyMethod
setFromMethodback to summary
public void setFromMethod()
setupback to summary
private void setup(Ruby runtime, Block procBlock)
sitesback to summary
private static JavaSites.ProcSites sites(ThreadContext context)

Hides org.jruby.RubyObject.sites.

Doc from org.jruby.RubyBasicObject.sites.

Retrieve the call sites for this class. It is expected that all Java-based core classes that do call site caching will have a similar method.

source_locationback to summary
public IRubyObject source_location(ThreadContext context)
Annotations
@JRubyMethod
to_procback to summary
public RubyProc to_proc()
Annotations
@JRubyMethod
name:to_proc
to_sback to summary
public IRubyObject to_s(ThreadContext context)

Overrides org.jruby.RubyBasicObject.to_s.

Annotations
@Override
@JRubyMethod
name:to_s
alias:inspect