Package org.jruby.runtime
Class BlockBody
java.lang.Object
org.jruby.runtime.BlockBody
- Direct Known Subclasses:
CallBlock
,CallBlock19
,ContextAwareBlockBody
,JavaInternalBlockBody
,NullBlockBody
The executable body portion of a closure.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BlockBody
protected final Signature
protected MethodHandle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarity()
Deprecated.call
(ThreadContext context, Block block) call
(ThreadContext context, Block block, Block unusedBlock) call
(ThreadContext context, Block block, IRubyObject arg0) call
(ThreadContext context, Block block, IRubyObject[] args) call
(ThreadContext context, Block block, IRubyObject[] args, Block blockArg) call
(ThreadContext context, Block block, IRubyObject arg0, Block unusedBlock) call
(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1) call
(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1, Block unusedBlock) call
(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) call
(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block unusedBlock) protected IRubyObject
callDirect
(ThreadContext context, Block block, IRubyObject[] args, Block blockArg) boolean
protected abstract IRubyObject
doYield
(ThreadContext context, Block block, IRubyObject value) Subclass specific yield implementation.protected abstract IRubyObject
doYield
(ThreadContext context, Block block, IRubyObject[] args, IRubyObject self) Subclass specific yield implementation.abstract String
getFile()
Get the filename for this blockabstract int
getLine()
get The line number for this blockabstract StaticScope
boolean
isGiven()
Is the current block a real yield'able block instead a null oneboolean
Is this block represented by Ruby code?prepareArgumentsForCall
(ThreadContext context, IRubyObject[] args, Block.Type type) abstract void
setStaticScope
(StaticScope newScope) static boolean
testBlockBody
(Block block, BlockBody body) final IRubyObject
yield
(ThreadContext context, Block block, IRubyObject value) final IRubyObject
yield
(ThreadContext context, Block block, IRubyObject[] args, IRubyObject self) yield
(ThreadContext context, Block block, IRubyObject[] args, IRubyObject self, Block blockArg) yield
(ThreadContext context, Block block, IRubyObject value, Block blockArg) protected IRubyObject
yieldDirect
(ThreadContext context, Block block, IRubyObject[] args, IRubyObject self) yieldSpecific
(ThreadContext context, Block block) yieldSpecific
(ThreadContext context, Block block, IRubyObject arg0) yieldSpecific
(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1) yieldSpecific
(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
-
Field Details
-
signature
-
testBlockBody
-
NULL_BODY
-
-
Constructor Details
-
BlockBody
-
-
Method Details
-
getSignature
-
canCallDirect
public boolean canCallDirect() -
getTestBlockBody
-
testBlockBody
-
callDirect
protected IRubyObject callDirect(ThreadContext context, Block block, IRubyObject[] args, Block blockArg) -
yieldDirect
protected IRubyObject yieldDirect(ThreadContext context, Block block, IRubyObject[] args, IRubyObject self) -
call
-
call
-
yield
-
yield
public final IRubyObject yield(ThreadContext context, Block block, IRubyObject[] args, IRubyObject self) -
doYield
Subclass specific yield implementation.Should not be called directly. Gets called by
yield(ThreadContext, Block, org.jruby.runtime.builtin.IRubyObject)
after ensuring that any common yield logic is taken care of. -
doYield
protected abstract IRubyObject doYield(ThreadContext context, Block block, IRubyObject[] args, IRubyObject self) Subclass specific yield implementation.Should not be called directly. Gets called by
yield(ThreadContext, Block, org.jruby.runtime.builtin.IRubyObject[], org.jruby.runtime.builtin.IRubyObject)
after ensuring that all common yield logic is taken care of. -
yield
public IRubyObject yield(ThreadContext context, Block block, IRubyObject[] args, IRubyObject self, Block blockArg) -
yield
-
call
-
call
-
yieldSpecific
-
call
-
call
-
yieldSpecific
-
call
-
call
public IRubyObject call(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1, Block unusedBlock) -
yieldSpecific
public IRubyObject yieldSpecific(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1) -
call
public IRubyObject call(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) -
call
public IRubyObject call(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block unusedBlock) -
yieldSpecific
public IRubyObject yieldSpecific(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) -
getStaticScope
-
setStaticScope
-
arity
Deprecated.What is the arity of this block?- Returns:
- the arity
-
isGiven
public boolean isGiven()Is the current block a real yield'able block instead a null one- Returns:
- true if this is a valid block or false otherwise
-
getFile
Get the filename for this block -
getLine
public abstract int getLine()get The line number for this block -
isRubyBlock
public boolean isRubyBlock()Is this block represented by Ruby code? -
prepareArgumentsForCall
public IRubyObject[] prepareArgumentsForCall(ThreadContext context, IRubyObject[] args, Block.Type type) -
getArgumentDescriptors
-