Class: Voom::Presenters::DSL::Components::IconToggle
- Inherits:
-
ToggleBase
- Object
- Base
- EventBase
- Input
- ToggleBase
- Voom::Presenters::DSL::Components::IconToggle
- Defined in:
- lib/voom/presenters/dsl/components/icon_toggle.rb
Instance Attribute Summary collapse
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#on_icon ⇒ Object
Returns the value of attribute on_icon.
-
#selected ⇒ Object
Returns the value of attribute selected.
Attributes inherited from ToggleBase
#checked, #off_value, #text, #text_color, #value
Attributes inherited from Input
Attributes inherited from EventBase
Attributes included from Mixins::Event
Attributes inherited from Base
#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type
Instance Method Summary collapse
-
#initialize(**attribs_, &block) ⇒ IconToggle
constructor
A new instance of IconToggle.
Methods inherited from Input
Methods included from Mixins::Tooltips
Methods included from Mixins::Event
Methods inherited from Base
Methods included from Pluggable
#include_plugins, #plugin, #plugin_module
Methods included from Mixins::YieldTo
Methods included from Serializer
Methods included from Lockable
Constructor Details
#initialize(**attribs_, &block) ⇒ IconToggle
Returns a new instance of IconToggle.
8 9 10 11 12 13 14 |
# File 'lib/voom/presenters/dsl/components/icon_toggle.rb', line 8 def initialize(**attribs_, &block) super(type: :icon_toggle, **attribs_, &block) @icon = attribs.delete(:icon) @on_icon = attribs.delete(:on_icon) { @icon } @selected = attribs.delete(:selected) { false } end |
Instance Attribute Details
#icon ⇒ Object
Returns the value of attribute icon.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/icon_toggle.rb', line 6 def icon @icon end |
#on_icon ⇒ Object
Returns the value of attribute on_icon.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/icon_toggle.rb', line 6 def on_icon @on_icon end |
#selected ⇒ Object
Returns the value of attribute selected.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/icon_toggle.rb', line 6 def selected @selected end |