Class: Ui::Switch::Component
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Ui::Switch::Component
- Defined in:
- lib/uikit_rails/templates/components/switch/component.rb
Overview
Toggle switch for boolean settings.
Instance Attribute Summary collapse
-
#checked ⇒ Object
readonly
Returns the value of attribute checked.
-
#html_attrs ⇒ Object
readonly
Returns the value of attribute html_attrs.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
-
#initialize(label: nil, checked: false, **html_attrs) ⇒ Component
constructor
A new instance of Component.
Constructor Details
#initialize(label: nil, checked: false, **html_attrs) ⇒ Component
Returns a new instance of Component.
9 10 11 12 13 14 |
# File 'lib/uikit_rails/templates/components/switch/component.rb', line 9 def initialize(label: nil, checked: false, **html_attrs) @label = label @checked = checked @html_attrs = html_attrs super() end |
Instance Attribute Details
#checked ⇒ Object (readonly)
Returns the value of attribute checked.
7 8 9 |
# File 'lib/uikit_rails/templates/components/switch/component.rb', line 7 def checked @checked end |
#html_attrs ⇒ Object (readonly)
Returns the value of attribute html_attrs.
7 8 9 |
# File 'lib/uikit_rails/templates/components/switch/component.rb', line 7 def html_attrs @html_attrs end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
7 8 9 |
# File 'lib/uikit_rails/templates/components/switch/component.rb', line 7 def label @label end |