org.jruby.runtime
Class MethodBlock
java.lang.Object
org.jruby.runtime.BlockBody
org.jruby.runtime.ContextAwareBlockBody
org.jruby.runtime.MethodBlock
public abstract class MethodBlock
- extends ContextAwareBlockBody
Internal live representation of a block ({...} or do ... end).
Method Summary |
IRubyObject |
call(ThreadContext context,
IRubyObject[] args,
Binding binding,
Block.Type type)
|
abstract IRubyObject |
callback(IRubyObject value,
IRubyObject method,
IRubyObject self,
Block block)
|
static Block |
createMethodBlock(ThreadContext context,
IRubyObject self,
DynamicScope dynamicScope,
MethodBlock body)
|
java.lang.String |
getFile()
Get the filename for this block |
int |
getLine()
get The line number for this block |
RubyMethod |
getMethod()
|
protected void |
post(ThreadContext context,
Binding binding,
Visibility visibility,
Frame lastFrame)
|
protected Frame |
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. |
IRubyObject |
yieldSpecific(ThreadContext context,
Binding binding,
Block.Type type)
|
IRubyObject |
yieldSpecific(ThreadContext context,
IRubyObject arg0,
Binding binding,
Block.Type type)
|
IRubyObject |
yieldSpecific(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
Binding binding,
Block.Type type)
|
IRubyObject |
yieldSpecific(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
Binding binding,
Block.Type type)
|
Methods inherited from class org.jruby.runtime.BlockBody |
asArgumentType, call, call, call, call, call, call, call, call, call, getArgumentType, getArgumentTypeWackyHack, getParameterList, isGiven, prepareArgumentsForCall, yield, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MethodBlock
public MethodBlock(RubyMethod method,
StaticScope staticScope)
createMethodBlock
public static Block createMethodBlock(ThreadContext context,
IRubyObject self,
DynamicScope dynamicScope,
MethodBlock body)
callback
public abstract IRubyObject callback(IRubyObject value,
IRubyObject method,
IRubyObject self,
Block block)
call
public IRubyObject call(ThreadContext context,
IRubyObject[] args,
Binding binding,
Block.Type type)
- Overrides:
call
in class BlockBody
pre
protected Frame pre(ThreadContext context,
RubyModule klass,
Binding binding)
- Overrides:
pre
in class ContextAwareBlockBody
post
protected void post(ThreadContext context,
Binding binding,
Visibility visibility,
Frame lastFrame)
- Overrides:
post
in class ContextAwareBlockBody
yieldSpecific
public IRubyObject yieldSpecific(ThreadContext context,
Binding binding,
Block.Type type)
- Overrides:
yieldSpecific
in class BlockBody
yieldSpecific
public IRubyObject yieldSpecific(ThreadContext context,
IRubyObject arg0,
Binding binding,
Block.Type type)
- Overrides:
yieldSpecific
in class BlockBody
yieldSpecific
public IRubyObject yieldSpecific(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
Binding binding,
Block.Type type)
- Overrides:
yieldSpecific
in class BlockBody
yieldSpecific
public IRubyObject yieldSpecific(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
Binding binding,
Block.Type type)
- Overrides:
yieldSpecific
in class BlockBody
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:
getFile
public java.lang.String getFile()
- Description copied from class:
BlockBody
- Get the filename for this block
- Specified by:
getFile
in class BlockBody
getLine
public int getLine()
- Description copied from class:
BlockBody
- get The line number for this block
- Specified by:
getLine
in class BlockBody
getMethod
public RubyMethod getMethod()
Copyright © 2002-2009 JRuby Team. All Rights Reserved.