Class: Spark::Input::Switch
- Inherits:
-
Checkbox
- Object
- ActionView::Component::Base
- Component::Base
- Base
- Checkbox
- Spark::Input::Switch
- Defined in:
- app/components/spark/input/switch.rb
Constant Summary collapse
- SIZE =
%i[small medium].freeze
- ALIGNMENT =
%i[left right].freeze
Instance Method Summary collapse
-
#initialize ⇒ Switch
constructor
A new instance of Switch.
- #switch_class ⇒ Object
Methods inherited from Component::Base
Constructor Details
#initialize ⇒ Switch
Returns a new instance of Switch.
12 13 14 15 16 17 |
# File 'app/components/spark/input/switch.rb', line 12 def initialize(*) super switch_class.add("size-#{@size}") switch_class.add("align-#{@align}") if @align end |
Instance Method Details
#switch_class ⇒ Object
19 20 21 |
# File 'app/components/spark/input/switch.rb', line 19 def switch_class @switch_class ||= Classname.new(base: "spark-input-switch") end |