Class: Yattho::Forms::ToggleSwitch
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Yattho::Forms::ToggleSwitch
- Defined in:
- lib/yattho/forms/toggle_switch.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes included from ActsAsComponent
Instance Method Summary collapse
-
#initialize(input:) ⇒ ToggleSwitch
constructor
A new instance of ToggleSwitch.
Methods inherited from BaseComponent
#content, inherited, #input?, #perform_render, #render?, #to_component, #type
Methods included from ActsAsComponent
#compile!, extended, #renders_templates
Methods included from ClassNameHelper
Constructor Details
#initialize(input:) ⇒ ToggleSwitch
Returns a new instance of ToggleSwitch.
9 10 11 12 13 14 |
# File 'lib/yattho/forms/toggle_switch.rb', line 9 def initialize(input:) @input = input @input.add_label_classes("FormControl-label") @input.add_input_classes("FormControl-toggleSwitchInput") @input.input_arguments[:hidden] = "hidden" if @input.hidden? end |