Module: Capybara::Widgets::StringHelpers

Defined in:
lib/capybara/widgets/helpers/string_helpers.rb

Instance Method Summary collapse

Instance Method Details

#apply_action_chain(widget, chain) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/capybara/widgets/helpers/string_helpers.rb', line 12

def apply_action_chain(widget, chain)
  if chain.length > 0
    next_widget = widget.send(chain[0])
    return apply_action_chain(next_widget, chain[1..-1])
  else
    return widget
  end
end

#to_widget_action(name, suffix = nil) ⇒ Object



8
9
10
# File 'lib/capybara/widgets/helpers/string_helpers.rb', line 8

def to_widget_action(name, suffix=nil)
  "#{name.to_s.strip.downcase.gsub(' ','_')}#{suffix}"
end

#to_widget_class(name) ⇒ Object



4
5
6
# File 'lib/capybara/widgets/helpers/string_helpers.rb', line 4

def to_widget_class(name)
  name.to_s.strip.gsub(' ','_').classify.constantize
end