Module: Bewildr::ControlPatterns::TogglePattern

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

Overview

These are not the toggle patterns you are looking for [wave of the hand/]. If you are dealing with a button, look for Bewildr::ControlPatterns::TogglePatternForButton. If you’re dealing with a checkbox, take a look at Bewildr::ControlPatterns::TogglePatternForCheckBox

Class Method Summary collapse

Class Method Details

.extended(base) ⇒ Object

:nodoc:



68
69
70
71
72
73
74
75
76
77
# File 'lib/bewildr/control_patterns/toggle_pattern.rb', line 68

def self.extended(base)
  base.instance_eval do
    case @control_type
    when :check_box
      base.extend(Bewildr::ControlPatterns::TogglePatternForCheckBox)
    when :button
      base.extend(Bewildr::ControlPatterns::TogglePatternForButton)
    end
  end
end