org.jruby.runtime
Class SharedScopeBlock

java.lang.Object
  extended byorg.jruby.runtime.Block
      extended byorg.jruby.runtime.SharedScopeBlock

public class SharedScopeBlock
extends Block

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.Block
arity, cref, dynamicScope, frame, isLambda, klass, NULL_BLOCK, self, visibility
 
Method Summary
 IRubyObject call(ThreadContext context, IRubyObject[] args, IRubyObject replacementSelf)
           
 Block cloneBlock()
           
static Block createSharedScopeBlock(ThreadContext context, IterNode iterNode, DynamicScope dynamicScope, IRubyObject self)
           
protected  void pre(ThreadContext context, RubyModule klass)
           
 
Methods inherited from class org.jruby.runtime.Block
arity, call, createBinding, createBlock, getCRef, getDynamicScope, getFrame, getKlass, getProcObject, getVisibility, isGiven, post, setProcObject, setSelf, setVisibility, yield, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createSharedScopeBlock

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

pre

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

call

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

cloneBlock

public Block cloneBlock()
Overrides:
cloneBlock in class Block


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