|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.runtime.Block
public class Block
Internal live representation of a block ({...} or do ... end).
Field Summary | |
---|---|
protected Arity |
arity
|
protected SinglyLinkedList |
cref
|
protected DynamicScope |
dynamicScope
A reference to all variable values (and names) that are in-scope for this block. |
protected Frame |
frame
frame of method which defined this block |
boolean |
isLambda
|
protected RubyModule |
klass
|
static Block |
NULL_BLOCK
All Block variables should either refer to a real block or this NULL_BLOCK. |
protected IRubyObject |
self
'self' at point when the block is defined |
protected Visibility |
visibility
|
Constructor Summary | |
---|---|
protected |
Block()
|
|
Block(IterNode iterNode,
IRubyObject self,
Frame frame,
SinglyLinkedList cref,
Visibility visibility,
RubyModule klass,
DynamicScope dynamicScope)
|
Method Summary | |
---|---|
Arity |
arity()
What is the arity of this block? |
IRubyObject |
call(ThreadContext context,
IRubyObject[] args)
|
Block |
cloneBlock()
|
static Block |
createBinding(Frame frame,
DynamicScope dynamicScope)
|
static Block |
createBlock(ThreadContext context,
IterNode iterNode,
DynamicScope dynamicScope,
IRubyObject self)
|
SinglyLinkedList |
getCRef()
|
DynamicScope |
getDynamicScope()
Gets the dynamicVariables that are local to this block. |
Frame |
getFrame()
Gets the frame. |
RubyModule |
getKlass()
Gets the klass. |
RubyProc |
getProcObject()
Retrieve the proc object associated with this block |
Visibility |
getVisibility()
|
boolean |
isGiven()
Is the current block a real yield'able block instead a null one |
protected void |
post(ThreadContext context)
|
protected void |
pre(ThreadContext context,
RubyModule klass)
|
void |
setProcObject(RubyProc procObject)
Set the proc object associated with this block |
void |
setSelf(IRubyObject self)
|
void |
setVisibility(Visibility visibility)
|
IRubyObject |
yield(ThreadContext context,
IRubyObject value)
|
IRubyObject |
yield(ThreadContext context,
IRubyObject value,
IRubyObject self,
RubyModule klass,
boolean aValue)
Yield to this block, usually passed to the current call. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Block NULL_BLOCK
protected IRubyObject self
protected Frame frame
protected SinglyLinkedList cref
protected Visibility visibility
protected RubyModule klass
protected DynamicScope dynamicScope
public boolean isLambda
protected Arity arity
Constructor Detail |
---|
protected Block()
public Block(IterNode iterNode, IRubyObject self, Frame frame, SinglyLinkedList cref, Visibility visibility, RubyModule klass, DynamicScope dynamicScope)
Method Detail |
---|
public static Block createBlock(ThreadContext context, IterNode iterNode, DynamicScope dynamicScope, IRubyObject self)
public static Block createBinding(Frame frame, DynamicScope dynamicScope)
public IRubyObject call(ThreadContext context, IRubyObject[] args)
protected void pre(ThreadContext context, RubyModule klass)
protected void post(ThreadContext context)
public IRubyObject yield(ThreadContext context, IRubyObject value)
public IRubyObject yield(ThreadContext context, IRubyObject value, IRubyObject self, RubyModule klass, boolean aValue)
context
- represents the current thread-specific datavalue
- The value to yield, either a single value or an array of valuesself
- The current selfklass
- aValue
- Should value be arrayified or not?
public Block cloneBlock()
public Arity arity()
public Visibility getVisibility()
public void setVisibility(Visibility visibility)
public void setSelf(IRubyObject self)
public SinglyLinkedList getCRef()
public RubyProc getProcObject()
public void setProcObject(RubyProc procObject)
procObject
- public DynamicScope getDynamicScope()
public Frame getFrame()
public RubyModule getKlass()
public boolean isGiven()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |