# File lib/cucumber/js_support/js_language.rb, line 33 def initialize(js_language, regexp, js_function) @js_language, @regexp, @js_function = js_language, regexp.to_s, js_function end
# File lib/cucumber/js_support/js_language.rb, line 46 def arguments_from(step_name) matches = eval_js "#{@regexp}.exec('#{step_name}')" if matches matches.to_a[1..-1].map do |match| JsArg.new(match) end end end
# File lib/cucumber/js_support/js_language.rb, line 55 def file_colon_line # Not possible yet to get file/line of js function with V8/therubyracer "" end
# File lib/cucumber/js_support/js_language.rb, line 37 def invoke(args) args = @js_language.execute_transforms(args) @js_language.current_world.execute(@js_function, args) end
# File lib/cucumber/js_support/js_language.rb, line 42 def regexp_source @regexp.inspect end