Module: Watir::Generator::Util

Defined in:
lib/watir-webdriver/generator/base/util.rb

Class Method Summary collapse

Class Method Details

.classify(regexp, str) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/watir-webdriver/generator/base/util.rb', line 7

def classify(regexp, str)
  if str =~ regexp
    $1
  else
    str
  end
end

.paramify(regexp, str) ⇒ Object



15
16
17
# File 'lib/watir-webdriver/generator/base/util.rb', line 15

def paramify(regexp, str)
  classify(regexp, str).snake_case
end