|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.runtime.Block
org.jruby.runtime.MethodBlock
Internal live representation of a block ({...} or do ... end).
Field Summary | |
protected Frame |
frame
frame of method which defined this block |
boolean |
isLambda
|
Fields inherited from class org.jruby.runtime.Block |
NULL_BLOCK |
Constructor Summary | |
MethodBlock(IRubyObject self,
Frame frame,
SinglyLinkedList cref,
Visibility visibility,
RubyModule klass,
DynamicScope dynamicScope,
Callback callback,
RubyMethod method)
|
Method Summary | |
Arity |
arity()
What is the arity of this block? |
IRubyObject |
call(ThreadContext context,
IRubyObject[] args)
|
Block |
cloneBlock()
|
static MethodBlock |
createMethodBlock(ThreadContext context,
DynamicScope dynamicScope,
Callback callback,
RubyMethod method,
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 org.jruby.runtime.Block |
createBinding, createBlock |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final Frame frame
public boolean isLambda
Constructor Detail |
public MethodBlock(IRubyObject self, Frame frame, SinglyLinkedList cref, Visibility visibility, RubyModule klass, DynamicScope dynamicScope, Callback callback, RubyMethod method)
Method Detail |
public static MethodBlock createMethodBlock(ThreadContext context, DynamicScope dynamicScope, Callback callback, RubyMethod method, IRubyObject self)
public IRubyObject call(ThreadContext context, IRubyObject[] args)
call
in class Block
protected void pre(ThreadContext context, RubyModule klass)
pre
in class Block
protected void post(ThreadContext context)
post
in class Block
public IRubyObject yield(ThreadContext context, IRubyObject value)
yield
in class Block
public IRubyObject yield(ThreadContext context, IRubyObject value, IRubyObject self, RubyModule klass, boolean aValue)
yield
in class Block
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()
cloneBlock
in class Block
public Arity arity()
arity
in class Block
public Visibility getVisibility()
getVisibility
in class Block
public void setVisibility(Visibility visibility)
setVisibility
in class Block
public void setSelf(IRubyObject self)
setSelf
in class Block
public SinglyLinkedList getCRef()
getCRef
in class Block
public RubyProc getProcObject()
getProcObject
in class Block
public void setProcObject(RubyProc procObject)
setProcObject
in class Block
procObject
- public DynamicScope getDynamicScope()
getDynamicScope
in class Block
public Frame getFrame()
getFrame
in class Block
public RubyModule getKlass()
getKlass
in class Block
public boolean isGiven()
isGiven
in class Block
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |