Class: ExecJS::ExternalRuntime
- Inherits:
-
Object
- Object
- ExecJS::ExternalRuntime
- Defined in:
- lib/execjs/external_runtime.rb
Defined Under Namespace
Classes: Context
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #available? ⇒ Boolean
- #compile(source) ⇒ Object
- #eval(source) ⇒ Object
- #exec(source) ⇒ Object
-
#initialize(options) ⇒ ExternalRuntime
constructor
A new instance of ExternalRuntime.
Constructor Details
#initialize(options) ⇒ ExternalRuntime
Returns a new instance of ExternalRuntime.
64 65 66 67 68 69 70 71 72 |
# File 'lib/execjs/external_runtime.rb', line 64 def initialize() @name = [:name] @command = [:command] @runner_path = [:runner_path] @test_args = [:test_args] @test_match = [:test_match] @conversion = [:conversion] @binary = locate_binary end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
62 63 64 |
# File 'lib/execjs/external_runtime.rb', line 62 def name @name end |
Instance Method Details
#available? ⇒ Boolean
88 89 90 91 |
# File 'lib/execjs/external_runtime.rb', line 88 def available? require "multi_json" @binary ? true : false end |
#compile(source) ⇒ Object
84 85 86 |
# File 'lib/execjs/external_runtime.rb', line 84 def compile(source) Context.new(self, source) end |