Parent

Methods

Files

Class/Module Index [+]

Quicksearch

Cucumber::JsSupport::JsTransform

Public Class Methods

new(js_language, regexp, js_function) click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 76
def initialize(js_language, regexp, js_function)
  @js_language, @regexp, @js_function = js_language, regexp.to_s, js_function
end

Public Instance Methods

invoke(arg) click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 86
def invoke(arg)
  @js_function.call([arg])
end
match(arg) click to toggle source
# File lib/cucumber/js_support/js_language.rb, line 80
def match(arg)
  arg = JsSupport.argument_safe_string(arg)
  matches = (eval_js "#{@regexp}.exec('#{arg}');").to_a
  matches.empty? ? nil : matches[1..-1]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.