Package org.jruby.embed.internal
Class EmbedEvalUnitImpl
java.lang.Object
org.jruby.embed.internal.EmbedEvalUnitImpl
- All Implemented Interfaces:
EmbedEvalUnit
,JavaEmbedUtils.EvalUnit
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 <[email protected]>
-
Method Details
-
getNode
Deprecated.Returns a root node of parsed Ruby script.- Specified by:
getNode
in interfaceEmbedEvalUnit
- Returns:
- a root node of parsed Ruby script
-
getLocalVarScope
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:
getLocalVarScope
in interfaceEmbedEvalUnit
- Returns:
- a scope to refer local variables
-
run
Evaluates a Ruby script, which has been parsed before.- Specified by:
run
in interfaceJavaEmbedUtils.EvalUnit
- Returns:
- results of executing this evaluation unit
-