org.jruby.runtime
Class Block

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

public final class Block
extends java.lang.Object

Internal live representation of a block ({...} or do ... end).


Nested Class Summary
static class Block.Type
           
 
Field Summary
static Block NULL_BLOCK
          All Block variables should either refer to a real block or this NULL_BLOCK.
 Block.Type type
           
 
Constructor Summary
Block(BlockBody body)
           
Block(BlockBody body, Binding binding)
           
 
Method Summary
 Arity arity()
          What is the arity of this block?
 IRubyObject call(ThreadContext context)
           
 IRubyObject call(ThreadContext context, Block block)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0)
           
 IRubyObject call(ThreadContext context, IRubyObject[] args)
           
 IRubyObject call(ThreadContext context, IRubyObject[] args, Block block)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, Block block)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, Block block)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, Block block)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, Block block)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, Block block)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, IRubyObject arg8)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, IRubyObject arg8, Block block)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, IRubyObject arg8, IRubyObject arg9)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, IRubyObject arg8, IRubyObject arg9, Block block)
           
 Block cloneBlock()
           
 void escape()
           
 Binding getBinding()
           
 BlockBody getBody()
           
 Frame getFrame()
          Gets the frame.
 RubyProc getProcObject()
          Retrieve the proc object associated with this block
 boolean isEscaped()
           
 boolean isGiven()
          Is the current block a real yield'able block instead a null one
 void setProcObject(RubyProc procObject)
          Set the proc object associated with this block
 IRubyObject yield(ThreadContext context, boolean aValue)
          Deprecated. 
 IRubyObject yield(ThreadContext context, IRubyObject value)
           
 IRubyObject yield(ThreadContext context, IRubyObject value, boolean aValue)
          Deprecated. 
 IRubyObject yield(ThreadContext context, IRubyObject value, IRubyObject self, RubyModule klass, boolean aValue)
           
 IRubyObject yieldSpecific(ThreadContext context)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, IRubyObject arg8)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, IRubyObject arg8, IRubyObject arg9)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

public Block.Type type

NULL_BLOCK

public static final Block NULL_BLOCK
All Block variables should either refer to a real block or this NULL_BLOCK.

Constructor Detail

Block

public Block(BlockBody body,
             Binding binding)

Block

public Block(BlockBody body)
Method Detail

call

public IRubyObject call(ThreadContext context,
                        IRubyObject[] args)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject[] args,
                        Block block)

call

public IRubyObject call(ThreadContext context)

call

public IRubyObject call(ThreadContext context,
                        Block block)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        Block block)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        Block block)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        Block block)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        Block block)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 IRubyObject arg3)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        Block block)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 IRubyObject arg3,
                                 IRubyObject arg4)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        Block block)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 IRubyObject arg3,
                                 IRubyObject arg4,
                                 IRubyObject arg5)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        IRubyObject arg6)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        IRubyObject arg6,
                        Block block)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 IRubyObject arg3,
                                 IRubyObject arg4,
                                 IRubyObject arg5,
                                 IRubyObject arg6)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        IRubyObject arg6,
                        IRubyObject arg7)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        IRubyObject arg6,
                        IRubyObject arg7,
                        Block block)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 IRubyObject arg3,
                                 IRubyObject arg4,
                                 IRubyObject arg5,
                                 IRubyObject arg6,
                                 IRubyObject arg7)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        IRubyObject arg6,
                        IRubyObject arg7,
                        IRubyObject arg8)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        IRubyObject arg6,
                        IRubyObject arg7,
                        IRubyObject arg8,
                        Block block)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 IRubyObject arg3,
                                 IRubyObject arg4,
                                 IRubyObject arg5,
                                 IRubyObject arg6,
                                 IRubyObject arg7,
                                 IRubyObject arg8)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        IRubyObject arg6,
                        IRubyObject arg7,
                        IRubyObject arg8,
                        IRubyObject arg9)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        IRubyObject arg6,
                        IRubyObject arg7,
                        IRubyObject arg8,
                        IRubyObject arg9,
                        Block block)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 IRubyObject arg3,
                                 IRubyObject arg4,
                                 IRubyObject arg5,
                                 IRubyObject arg6,
                                 IRubyObject arg7,
                                 IRubyObject arg8,
                                 IRubyObject arg9)

yield

public IRubyObject yield(ThreadContext context,
                         IRubyObject value)

yield

public IRubyObject yield(ThreadContext context,
                         IRubyObject value,
                         IRubyObject self,
                         RubyModule klass,
                         boolean aValue)

yield

@Deprecated
public IRubyObject yield(ThreadContext context,
                                    IRubyObject value,
                                    boolean aValue)
Deprecated. 


yield

@Deprecated
public IRubyObject yield(ThreadContext context,
                                    boolean aValue)
Deprecated. 


cloneBlock

public Block cloneBlock()

arity

public Arity arity()
What is the arity of this block?

Returns:
the arity

getProcObject

public RubyProc getProcObject()
Retrieve the proc object associated with this block

Returns:
the proc or null if this has no proc associated with it

setProcObject

public void setProcObject(RubyProc procObject)
Set the proc object associated with this block

Parameters:
procObject -

isGiven

public final boolean isGiven()
Is the current block a real yield'able block instead a null one

Returns:
true if this is a valid block or false otherwise

getBinding

public Binding getBinding()

getBody

public BlockBody getBody()

getFrame

public Frame getFrame()
Gets the frame.

Returns:
Returns a RubyFrame

isEscaped

public boolean isEscaped()

escape

public void escape()


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