Class: Cucumber::JsSupport::JsWorld
- Defined in:
- lib/cucumber/js_support/js_language.rb
Instance Method Summary collapse
- #execute(js_function, args = []) ⇒ Object
-
#initialize ⇒ JsWorld
constructor
A new instance of JsWorld.
- #method_missing(method_name, *args) ⇒ Object
Constructor Details
#initialize ⇒ JsWorld
Returns a new instance of JsWorld.
19 20 21 |
# File 'lib/cucumber/js_support/js_language.rb', line 19 def initialize @world = V8::Context.new end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
27 28 29 |
# File 'lib/cucumber/js_support/js_language.rb', line 27 def method_missing(method_name, *args) @world.send(method_name, *args) end |
Instance Method Details
#execute(js_function, args = []) ⇒ Object
23 24 25 |
# File 'lib/cucumber/js_support/js_language.rb', line 23 def execute(js_function, args=[]) js_function.call(*args) end |