Top Description Fields Constructors Methods
org.jruby.embed.internal

public Class EmbedEvalUnitImpl

extends Object
implements EmbedEvalUnit
Class Inheritance
All Implemented Interfaces
org.jruby.embed.EmbedEvalUnit, org.jruby.javasupport.JavaEmbedUtils.EvalUnit
Imports
org.jruby.ParseResult, .Ruby, .RubyInstanceConfig.CompileMode, .RubySystemExit, org.jruby.ast.Node, org.jruby.ast.executable.Script, org.jruby.embed.AttributeName, .EmbedEvalUnit, .EvalFailedException, .ScriptingContainer, org.jruby.exceptions.RaiseException, org.jruby.runtime.DynamicScope, .Helpers, .ThreadContext, org.jruby.runtime.builtin.IRubyObject

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]>

Field Summary

Modifier and TypeField and Description
private final ScriptingContainer
private final ParseResult
private final DynamicScope
private final Script
private final boolean

Constructor Summary

AccessConstructor and Description
pack-priv
EmbedEvalUnitImpl(ScriptingContainer container, ParseResult parseResult, DynamicScope scope, Script script, boolean wrapExceptions)

Method Summary

Modifier and TypeMethod and Description
public DynamicScope

Returns:

a scope to refer local variables
getLocalVarScope
()

Implements org.jruby.embed.EmbedEvalUnit.getLocalVarScope.

Returns a ManyVarsDynamicScope used to parse a script.

public Node

Returns:

a root node of parsed Ruby script
getNode
()

Implements org.jruby.embed.EmbedEvalUnit.getNode.

Deprecated

Returns a root node of parsed Ruby script.

pack-priv static boolean
public IRubyObject

Returns:

results of executing this evaluation unit
run
()

Implements org.jruby.javasupport.JavaEmbedUtils.EvalUnit.run.

Evaluates a Ruby script, which has been parsed before.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

containerback to summary
private final ScriptingContainer container
parseResultback to summary
private final ParseResult parseResult
scopeback to summary
private final DynamicScope scope
scriptback to summary
private final Script script
wrapExceptionsback to summary
private final boolean wrapExceptions

Constructor Detail

EmbedEvalUnitImplback to summary
pack-priv EmbedEvalUnitImpl(ScriptingContainer container, ParseResult parseResult, DynamicScope scope, Script script, boolean wrapExceptions)

Method Detail

getLocalVarScopeback to summary
public DynamicScope getLocalVarScope()

Implements org.jruby.embed.EmbedEvalUnit.getLocalVarScope.

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

Returns:DynamicScope

a scope to refer local variables

getNodeback to summary
public Node getNode()

Implements org.jruby.embed.EmbedEvalUnit.getNode.

Deprecated

Returns a root node of parsed Ruby script.

Returns:Node

a root node of parsed Ruby script

Annotations
@Deprecated
isSharingVariablesback to summary
pack-priv static boolean isSharingVariables(ScriptingContainer container)
runback to summary
public IRubyObject run()

Implements org.jruby.javasupport.JavaEmbedUtils.EvalUnit.run.

Evaluates a Ruby script, which has been parsed before.

Returns:IRubyObject

results of executing this evaluation unit