Module: Pincers::Extension::Actions

Included in:
Core::SearchContext
Defined in:
lib/pincers/extension/actions.rb

Instance Method Summary collapse

Instance Method Details

#set(_value = true, _options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/pincers/extension/actions.rb', line 4

def set(_value=true, _options={})

  if _value.is_a? Hash
    _options = _value
    _value = true
  end

  case input_mode
  when :text
    set_text _value.to_s
  when :select
    return set_selected _value, _options
  when :checkbox, :radio
    return set_checked _value
  when :button
    click if _value
  else
    return false
  end
  true
end