Module: Watir::Generator::Util

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

Class Method Summary collapse

Class Method Details

.classify(regexp, str) ⇒ Object


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

def classify(regexp, str)
  if str =~ regexp
    Regexp.last_match(1)
  else
    str
  end
end

.paramify(regexp, str) ⇒ Object


14
15
16
# File 'lib/watir/generator/base/util.rb', line 14

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