Class: Ui::Switch::Component

Inherits:
BaseComponent
  • Object
show all
Defined in:
lib/uikit_rails/templates/components/switch/component.rb

Overview

Toggle switch for boolean settings.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#checkedObject (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_attrsObject (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

#labelObject (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