Top Description Fields Constructors Methods
org.jruby.runtime

public abstract Class BlockBody

extends Object
Class Inheritance
Known Direct Subclasses
org.jruby.runtime.CallBlock, org.jruby.runtime.CallBlock19, org.jruby.runtime.ContextAwareBlockBody, org.jruby.runtime.JavaInternalBlockBody, org.jruby.runtime.NullBlockBody
Imports
com.headius.invokebinder.Binder, org.jruby.EvalType, .RubyArray, .RubyProc, org.jruby.ir.runtime.IRRuntimeHelpers, org.jruby.parser.StaticScope, org.jruby.runtime.builtin.IRubyObject, java.lang.invoke.MethodHandle, .MethodHandles

The executable body portion of a closure.

Field Summary

Modifier and TypeField and Description
public static final BlockBody
protected final Signature
private static final MethodHandle
protected MethodHandle

Constructor Summary

AccessConstructor and Description
public
BlockBody(Signature signature)

Method Summary

Modifier and TypeMethod and Description
public Arity

Returns:

the arity
arity
()
Deprecated

What is the arity of this block?

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

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

public IRubyObject
call(ThreadContext context, Block block)

public IRubyObject
call(ThreadContext context, Block block, Block unusedBlock)

public IRubyObject
call(ThreadContext context, Block block, IRubyObject arg0)

public IRubyObject
call(ThreadContext context, Block block, IRubyObject arg0, Block unusedBlock)

public IRubyObject
call(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1)

public IRubyObject
call(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1, Block unusedBlock)

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

public IRubyObject
call(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block unusedBlock)

protected IRubyObject
callDirect(ThreadContext context, Block block, IRubyObject[] args, Block blockArg)

public 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.

public ArgumentDescriptor[]
public abstract String
getFile()

Get the filename for this block

public abstract int
getLine()

get The line number for this block

public Signature
public abstract StaticScope
public MethodHandle
public boolean

Returns:

true if this is a valid block or false otherwise
isGiven
()

Is the current block a real yield'able block instead a null one

public boolean
isRubyBlock()

Is this block represented by Ruby code?

public IRubyObject[]
public abstract void
public static boolean
public final IRubyObject
yield(ThreadContext context, Block block, IRubyObject value)

public final IRubyObject
yield(ThreadContext context, Block block, IRubyObject[] args, IRubyObject self)

public IRubyObject
yield(ThreadContext context, Block block, IRubyObject[] args, IRubyObject self, Block blockArg)

public IRubyObject
yield(ThreadContext context, Block block, IRubyObject value, Block blockArg)

protected IRubyObject
yieldDirect(ThreadContext context, Block block, IRubyObject[] args, IRubyObject self)

public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

NULL_BODYback to summary
public static final BlockBody NULL_BODY
signatureback to summary
protected final Signature signature
TEST_BLOCK_BODYback to summary
private static final MethodHandle TEST_BLOCK_BODY
testBlockBodyback to summary
protected MethodHandle testBlockBody

Constructor Detail

BlockBodyback to summary
public BlockBody(Signature signature)

Method Detail

arityback to summary
public Arity arity()

Deprecated

What is the arity of this block?

Returns:Arity

the arity

Annotations
@Deprecated
callback to summary
public IRubyObject call(ThreadContext context, Block block, IRubyObject[] args)
callback to summary
public IRubyObject call(ThreadContext context, Block block, IRubyObject[] args, Block blockArg)
callback to summary
public IRubyObject call(ThreadContext context, Block block)
callback to summary
public IRubyObject call(ThreadContext context, Block block, Block unusedBlock)
callback to summary
public IRubyObject call(ThreadContext context, Block block, IRubyObject arg0)
callback to summary
public IRubyObject call(ThreadContext context, Block block, IRubyObject arg0, Block unusedBlock)
callback to summary
public IRubyObject call(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1)
callback to summary
public IRubyObject call(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1, Block unusedBlock)
callback to summary
public IRubyObject call(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
callback to summary
public IRubyObject call(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block unusedBlock)
callDirectback to summary
protected IRubyObject callDirect(ThreadContext context, Block block, IRubyObject[] args, Block blockArg)
canCallDirectback to summary
public boolean canCallDirect()
doYieldback to summary
protected abstract IRubyObject doYield(ThreadContext context, Block block, IRubyObject value)

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.

doYieldback to summary
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.

getArgumentDescriptorsback to summary
public ArgumentDescriptor[] getArgumentDescriptors()
getFileback to summary
public abstract String getFile()

Get the filename for this block

getLineback to summary
public abstract int getLine()

get The line number for this block

getSignatureback to summary
public Signature getSignature()
getStaticScopeback to summary
public abstract StaticScope getStaticScope()
getTestBlockBodyback to summary
public MethodHandle getTestBlockBody()
isGivenback to summary
public boolean isGiven()

Is the current block a real yield'able block instead a null one

Returns:boolean

true if this is a valid block or false otherwise

isRubyBlockback to summary
public boolean isRubyBlock()

Is this block represented by Ruby code?

prepareArgumentsForCallback to summary
public IRubyObject[] prepareArgumentsForCall(ThreadContext context, IRubyObject[] args, Block.Type type)
setStaticScopeback to summary
public abstract void setStaticScope(StaticScope newScope)
testBlockBodyback to summary
public static boolean testBlockBody(Block block, BlockBody body)
yieldback to summary
public final IRubyObject yield(ThreadContext context, Block block, IRubyObject value)
yieldback to summary
public final IRubyObject yield(ThreadContext context, Block block, IRubyObject[] args, IRubyObject self)
yieldback to summary
public IRubyObject yield(ThreadContext context, Block block, IRubyObject[] args, IRubyObject self, Block blockArg)
yieldback to summary
public IRubyObject yield(ThreadContext context, Block block, IRubyObject value, Block blockArg)
yieldDirectback to summary
protected IRubyObject yieldDirect(ThreadContext context, Block block, IRubyObject[] args, IRubyObject self)
yieldSpecificback to summary
public IRubyObject yieldSpecific(ThreadContext context, Block block)
yieldSpecificback to summary
public IRubyObject yieldSpecific(ThreadContext context, Block block, IRubyObject arg0)
yieldSpecificback to summary
public IRubyObject yieldSpecific(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1)
yieldSpecificback to summary
public IRubyObject yieldSpecific(ThreadContext context, Block block, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)