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 BlockBodyprotected final Signatureprivate static final MethodHandleprotected 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 IRubyObjectcallDirect(ThreadContext context, Block block, IRubyObject[] args, Block blockArg) booleanprotected abstract IRubyObjectdoYield(ThreadContext context, Block block, IRubyObject value) Subclass specific yield implementation.protected abstract IRubyObjectdoYield(ThreadContext context, Block block, IRubyObject[] args, IRubyObject self) Subclass specific yield implementation.abstract StringgetFile()Get the filename for this blockabstract intgetLine()get The line number for this blockabstract StaticScopebooleanisGiven()Is the current block a real yield'able block instead a null oneprepareArgumentsForCall(ThreadContext context, IRubyObject[] args, Block.Type type) abstract voidsetStaticScope(StaticScope newScope) static booleantestBlockBody(Block block, BlockBody body) final IRubyObjectyield(ThreadContext context, Block block, IRubyObject value) final IRubyObjectyield(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 IRubyObjectyieldDirect(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
-
TEST_BLOCK_BODY
-
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 -
prepareArgumentsForCall
public IRubyObject[] prepareArgumentsForCall(ThreadContext context, IRubyObject[] args, Block.Type type) -
getArgumentDescriptors
-