org.jruby.runtime
Class MethodBlock
java.lang.Object
org.jruby.runtime.BlockBody
org.jruby.runtime.MethodBlock
- All Implemented Interfaces:
- JumpTarget
public class MethodBlock
- extends BlockBody
Internal live representation of a block ({...} or do ... end).
Method Summary |
Arity |
arity()
What is the arity of this block? |
IRubyObject |
call(ThreadContext context,
IRubyObject[] args,
Binding binding,
Block.Type type)
|
Block |
cloneBlock(Binding binding)
|
static Block |
createMethodBlock(ThreadContext context,
DynamicScope dynamicScope,
Callback callback,
RubyMethod method,
IRubyObject self)
|
StaticScope |
getStaticScope()
|
protected void |
post(ThreadContext context,
Binding binding)
|
protected void |
pre(ThreadContext context,
RubyModule klass,
Binding binding)
|
IRubyObject |
yield(ThreadContext context,
IRubyObject value,
Binding binding,
Block.Type type)
|
IRubyObject |
yield(ThreadContext context,
IRubyObject value,
IRubyObject self,
RubyModule klass,
boolean aValue,
Binding binding,
Block.Type type)
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 |
MethodBlock
public MethodBlock(Callback callback,
RubyMethod method,
StaticScope staticScope)
createMethodBlock
public static Block createMethodBlock(ThreadContext context,
DynamicScope dynamicScope,
Callback callback,
RubyMethod method,
IRubyObject self)
call
public IRubyObject call(ThreadContext context,
IRubyObject[] args,
Binding binding,
Block.Type type)
- Specified by:
call
in class BlockBody
pre
protected void pre(ThreadContext context,
RubyModule klass,
Binding binding)
post
protected void post(ThreadContext context,
Binding binding)
yield
public IRubyObject yield(ThreadContext context,
IRubyObject value,
Binding binding,
Block.Type type)
- Specified by:
yield
in class BlockBody
yield
public IRubyObject yield(ThreadContext context,
IRubyObject value,
IRubyObject self,
RubyModule klass,
boolean aValue,
Binding binding,
Block.Type type)
- Yield to this block, usually passed to the current call.
- Specified by:
yield
in class BlockBody
- Parameters:
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?
- Returns:
getStaticScope
public StaticScope getStaticScope()
- Specified by:
getStaticScope
in class BlockBody
cloneBlock
public Block cloneBlock(Binding binding)
- Specified by:
cloneBlock
in class BlockBody
arity
public Arity arity()
- What is the arity of this block?
- Specified by:
arity
in class BlockBody
- Returns:
- the arity
Copyright © 2002-2007 JRuby Team. All Rights Reserved.