org.jruby.runtime
Class CompiledBlock

java.lang.Object
  extended by org.jruby.runtime.Block
      extended by org.jruby.runtime.CompiledBlock

public class CompiledBlock
extends Block

A Block implemented using a Java-based BlockCallback implementation rather than with an ICallable. For lightweight block logic within Java code.


Field Summary
 
Fields inherited from class org.jruby.runtime.Block
arity, cref, dynamicScope, frame, isLambda, klass, NULL_BLOCK, self, visibility
 
Constructor Summary
CompiledBlock(ThreadContext context, IRubyObject self, Arity arity, DynamicScope dynamicScope, CompiledBlockCallback callback)
           
 
Method Summary
 Arity arity()
          What is the arity of this block?
 IRubyObject call(ThreadContext context, IRubyObject[] args)
           
 Block cloneBlock()
           
protected  void post(ThreadContext context)
           
protected  void pre(ThreadContext context, RubyModule klass)
           
 IRubyObject yield(ThreadContext context, IRubyObject args, 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, getCRef, getDynamicScope, getFrame, getKlass, getProcObject, getVisibility, isGiven, setProcObject, setSelf, setVisibility, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompiledBlock

public CompiledBlock(ThreadContext context,
                     IRubyObject self,
                     Arity arity,
                     DynamicScope dynamicScope,
                     CompiledBlockCallback callback)
Method Detail

pre

protected void pre(ThreadContext context,
                   RubyModule klass)
Overrides:
pre in class Block

post

protected void post(ThreadContext context)
Overrides:
post in class Block

call

public IRubyObject call(ThreadContext context,
                        IRubyObject[] args)
Overrides:
call in class Block

yield

public IRubyObject yield(ThreadContext context,
                         IRubyObject args,
                         IRubyObject self,
                         RubyModule klass,
                         boolean aValue)
Description copied from class: Block
Yield to this block, usually passed to the current call.

Overrides:
yield in class Block
Parameters:
context - represents the current thread-specific data
args - The value to yield, either a single value or an array of values
self - The current self
aValue - Should value be arrayified or not?
Returns:

cloneBlock

public Block cloneBlock()
Overrides:
cloneBlock in class Block

arity

public Arity arity()
Description copied from class: Block
What is the arity of this block?

Overrides:
arity in class Block
Returns:
the arity


Copyright © 2002-2007 JRuby Team. All Rights Reserved.