Top Level Namespace

Defined Under Namespace

Classes: Shoes

Constant Summary collapse

NAME_METHOD_MAPPING =
{ "button" => "button",
"paragraph" => "para",
"link" => "link" }

Instance Method Summary collapse

Instance Method Details

#class_for(element_name) ⇒ Object



14
15
16
# File 'lib/shoes/cucumber/helper/helper.rb', line 14

def class_for(element_name)
  Shoes.const_get(singularize(element_name).capitalize)
end

#singularize(string) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/shoes/cucumber/helper/helper.rb', line 5

def singularize(string)
  # for now it's easy enough, get rid of the s
  if string[-1] == "s"
    string.chop
  else
    string
  end
end