Class: Cucumber::JsSupport::JsWorld

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/js_support/js_language.rb

Instance Method Summary collapse

Constructor Details

#initializeJsWorld

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