Package org.tentackle.script.ruby
Class RubyScript
java.lang.Object
org.tentackle.script.AbstractScript
org.tentackle.script.ruby.RubyScript
- All Implemented Interfaces:
Script
A Ruby script.
- Author:
- harald
-
Constructor Summary
ConstructorDescriptionRubyScript
(RubyLanguage language, org.jruby.embed.ScriptingContainer container, String code, boolean cached, boolean threadSafe) Creates a ruby script. -
Method Summary
Modifier and TypeMethodDescriptionprotected CompiledRubyScript
compileScript
(String code) Compiles script code.<T> T
execute
(Set<ScriptVariable> variables) protected <T> T
executeImpl
(CompiledRubyScript script, Collection<ScriptVariable> variables) protected CompiledRubyScript
Gets the compiled script.
Will be parsed if not done yet.void
validate()
Methods inherited from class org.tentackle.script.AbstractScript
execute, getCode, getLanguage, isCached, isThreadSafe, toString
-
Constructor Details
-
RubyScript
public RubyScript(RubyLanguage language, org.jruby.embed.ScriptingContainer container, String code, boolean cached, boolean threadSafe) Creates a ruby script.- Parameters:
language
- the languagecode
- the scripting codecached
- true if cachedthreadSafe
- true if thread-safety required
-
-
Method Details
-
validate
public void validate() -
execute
-
getCompiledScript
Gets the compiled script.
Will be parsed if not done yet.- Returns:
- the compiled script
-
compileScript
Compiles script code.- Parameters:
code
- the scripting source code- Returns:
- the compiled script
-
executeImpl
-