org.jruby.runtime
Class SharedScopeBlock

java.lang.Object
  extended by org.jruby.runtime.BlockBody
      extended by org.jruby.runtime.InterpretedBlock
          extended by org.jruby.runtime.SharedScopeBlock
All Implemented Interfaces:
JumpTarget

public class SharedScopeBlock
extends InterpretedBlock

Represents the live state of a for or END construct in Ruby. This is different from an ordinary block in that it does not have its own scoped variables. It leeches those from the next outer scope. Because of this we do not set up, clone, nor tear down scope-related stuff. Also because of this we do not need to clone the block since it state does not change.


Field Summary
 
Fields inherited from class org.jruby.runtime.BlockBody
argumentType, ARRAY, MULTIPLE_ASSIGNMENT, NULL_BODY, SINGLE_RESTARG, ZERO_ARGS
 
Constructor Summary
protected SharedScopeBlock(IterNode iterNode)
           
 
Method Summary
 IRubyObject call(ThreadContext context, IRubyObject[] args, IRubyObject replacementSelf, Binding binding, Block.Type type)
           
 Block cloneBlock(Binding binding)
           
static Block newInterpretedSharedScopeClosure(ThreadContext context, IterNode iterNode, DynamicScope dynamicScope, IRubyObject self)
           
protected  Frame pre(ThreadContext context, RubyModule klass, Binding binding)
           
 
Methods inherited from class org.jruby.runtime.InterpretedBlock
arity, getIterNode, getStaticScope, newInterpretedClosure, newInterpretedClosure, newInterpretedClosure, post, yield, yield
 
Methods inherited from class org.jruby.runtime.BlockBody
asArgumentType, call, getArgumentType, getArgumentTypeWackyHack, isGiven, prepareArgumentsForCall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SharedScopeBlock

protected SharedScopeBlock(IterNode iterNode)
Method Detail

newInterpretedSharedScopeClosure

public static Block newInterpretedSharedScopeClosure(ThreadContext context,
                                                     IterNode iterNode,
                                                     DynamicScope dynamicScope,
                                                     IRubyObject self)

pre

protected Frame pre(ThreadContext context,
                    RubyModule klass,
                    Binding binding)
Overrides:
pre in class InterpretedBlock

call

public IRubyObject call(ThreadContext context,
                        IRubyObject[] args,
                        IRubyObject replacementSelf,
                        Binding binding,
                        Block.Type type)

cloneBlock

public Block cloneBlock(Binding binding)
Overrides:
cloneBlock in class InterpretedBlock


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