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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ScriptingContainerprivate final Nodeprivate final DynamicScopeprivate final Scriptprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionEmbedEvalUnitImpl(ScriptingContainer container, Node node, DynamicScope scope, Script script, boolean wrapExceptions) -
Method Summary
Modifier and TypeMethodDescriptionReturns a ManyVarsDynamicScope used to parse a script.getNode()Returns a root node of parsed Ruby script.(package private) static booleanisSharingVariables(ScriptingContainer container) 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, waitMethods inherited from interface org.jruby.embed.EmbedEvalUnit
getScope
-
Field Details
-
container
-
node
-
scope
-
script
-
wrapExceptions
private final boolean wrapExceptions
-
-
Constructor Details
-
EmbedEvalUnitImpl
EmbedEvalUnitImpl(ScriptingContainer container, Node node, DynamicScope scope, Script script, boolean wrapExceptions)
-
-
Method Details
-
getNode
Returns a root node of parsed Ruby script.- Specified by:
getNodein 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:
getLocalVarScopein interfaceEmbedEvalUnit- Returns:
- a scope to refer local variables
-
run
Evaluates a Ruby script, which has been parsed before.- Specified by:
runin interfaceJavaEmbedUtils.EvalUnit- Returns:
- results of executing this evaluation unit
-
isSharingVariables
-