Module: Bewildr::ControlPatterns::TogglePatternForButton
- Defined in:
- lib/bewildr/control_patterns/toggle_pattern.rb
Instance Method Summary collapse
-
#toggle ⇒ Object
Toggle the element.
-
#toggle_off ⇒ Object
Toggle off the element.
-
#toggle_on ⇒ Object
Toggle on the element.
-
#toggle_state ⇒ Object
Return the toggle state.
Instance Method Details
#toggle ⇒ Object
Toggle the element
25 26 27 |
# File 'lib/bewildr/control_patterns/toggle_pattern.rb', line 25 def toggle flip_state end |
#toggle_off ⇒ Object
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_on ⇒ Object
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_state ⇒ Object
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 |