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, #text, #value

Attributes inherited from Input

#name

Attributes inherited from EventBase

#event_parent_id

Attributes included from Mixins::Event

#events

Attributes inherited from Base

#attributes, #context, #id, #type

Instance Method Summary collapse

Methods included from Mixins::Tooltips

#tooltip

Methods included from Mixins::Event

#event

Methods inherited from Base

#expand!

Methods included from Serializer

#to_hash

Methods included from Lockable

#lock!, #locked?

Constructor Details

#initialize(**attribs_, &block) ⇒ IconToggle

Returns a new instance of IconToggle.



10
11
12
13
14
15
16
# File 'lib/voom/presenters/dsl/components/icon_toggle.rb', line 10

def initialize(**attribs_, &block)
  super(type: :icon_toggle, context: context, **attribs_, &block)
  @icon = attribs.delete(:icon)
  @selected = attribs.delete(:selected) || false
  @disabled = attribs.delete(:disabled) || false
  expand!
end

Instance Attribute Details

#disabledObject

Returns the value of attribute disabled.



8
9
10
# File 'lib/voom/presenters/dsl/components/icon_toggle.rb', line 8

def disabled
  @disabled
end

#iconObject

Returns the value of attribute icon.



8
9
10
# File 'lib/voom/presenters/dsl/components/icon_toggle.rb', line 8

def icon
  @icon
end

#selectedObject

Returns the value of attribute selected.



8
9
10
# File 'lib/voom/presenters/dsl/components/icon_toggle.rb', line 8

def selected
  @selected
end