Module: Bewildr::ControlPatterns::TogglePatternForButton

Defined in:
lib/bewildr/control_patterns/toggle_pattern.rb

Instance Method Summary collapse

Instance Method Details

#toggleObject

Toggle the element



25
26
27
# File 'lib/bewildr/control_patterns/toggle_pattern.rb', line 25

def toggle
  flip_state
end

#toggle_offObject

Toggle off the element



12
13
14
# File 'lib/bewildr/control_patterns/toggle_pattern.rb', line 12

def toggle_off
  set_state_to(:off)
end

#toggle_onObject

Toggle on the element



7
8
9
# File 'lib/bewildr/control_patterns/toggle_pattern.rb', line 7

def toggle_on
  set_state_to(:on)
end

#toggle_stateObject

Return the toggle state. The available states are:

:on
:off
:indeterminate


20
21
22
# File 'lib/bewildr/control_patterns/toggle_pattern.rb', line 20

def toggle_state
  state
end