Class: Voom::Presenters::DSL::Components::IconToggle

Inherits:
ToggleBase show all
Defined in:
lib/voom/presenters/dsl/components/icon_toggle.rb

Instance Attribute Summary collapse

Attributes inherited from ToggleBase

#checked, #off_value, #text, #text_color, #value

Attributes inherited from Input

#dirtyable, #disabled, #name

Attributes inherited from EventBase

#event_parent_id

Attributes included from Mixins::Event

#events

Attributes inherited from Base

#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type

Instance Method Summary collapse

Methods inherited from Input

#validation_error

Methods included from Mixins::Tooltips

#tooltip

Methods included from Mixins::Event

#event

Methods inherited from Base

#expand!

Methods included from Pluggable

#include_plugins, #plugin, #plugin_module

Methods included from Mixins::YieldTo

#yield_to

Methods included from Serializer

#to_hash

Methods included from Lockable

#locked?

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 }
  expand!
end

Instance Attribute Details

#iconObject

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_iconObject

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

#selectedObject

Returns the value of attribute selected.



6
7
8
# File 'lib/voom/presenters/dsl/components/icon_toggle.rb', line 6

def selected
  @selected
end