org.jruby.embed.internal
Class EmbedEvalUnitImpl

java.lang.Object
  extended by org.jruby.embed.internal.EmbedEvalUnitImpl
All Implemented Interfaces:
EmbedEvalUnit, JavaEmbedUtils.EvalUnit

public class EmbedEvalUnitImpl
extends java.lang.Object
implements EmbedEvalUnit

Implementation of org.jruby.javasupport.JavaEmbedUtils.EvalUnit for embeddiing. This class is created when a Ruby script has been parsed. Once parsed, the script is ready to run many times without parsing.

Users do not instantiate explicitly. Instead, they can get the instance by parsing Ruby script by parse method of ScriptingContainer.

Author:
Yoko Harada

Constructor Summary
EmbedEvalUnitImpl(ScriptingContainer container, Node node, ManyVarsDynamicScope scope)
           
EmbedEvalUnitImpl(ScriptingContainer container, Node node, ManyVarsDynamicScope scope, Script script)
           
 
Method Summary
 Node getNode()
          Returns a root node of parsed Ruby script.
 ManyVarsDynamicScope getScope()
          Returns a ManyVarsDynamicScope used to parse a script.
 IRubyObject run()
          Evaluates a Ruby script, which has been parsed before.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbedEvalUnitImpl

public EmbedEvalUnitImpl(ScriptingContainer container,
                         Node node,
                         ManyVarsDynamicScope scope)

EmbedEvalUnitImpl

public EmbedEvalUnitImpl(ScriptingContainer container,
                         Node node,
                         ManyVarsDynamicScope scope,
                         Script script)
Method Detail

getNode

public Node getNode()
Returns a root node of parsed Ruby script.

Specified by:
getNode in interface EmbedEvalUnit
Returns:
a root node of parsed Ruby script

getScope

public ManyVarsDynamicScope getScope()
Returns a ManyVarsDynamicScope used to parse a script. A returned value is used to inject Ruby's local variable when script is evaluated.

Specified by:
getScope in interface EmbedEvalUnit
Returns:
a scope to refer local variables

run

public IRubyObject run()
Evaluates a Ruby script, which has been parsed before.

Specified by:
run in interface JavaEmbedUtils.EvalUnit
Returns:
results of executing this evaluation unit


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