Class: Voom::Presenters::DSL::Components::IconBase

Inherits:
EventBase
  • Object
show all
Includes:
Mixins::Tooltips
Defined in:
lib/voom/presenters/dsl/components/icon_base.rb

Direct Known Subclasses

Chip::Icon, Icon

Instance Attribute Summary collapse

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 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) ⇒ IconBase

Returns a new instance of IconBase.



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

def initialize(**attribs_, &block)
  super(type: :icon,
        **attribs_, &block)
  @icon     = attribs.delete(:icon)
  @color    = attribs.delete(:color)
  @size     = attribs.delete(:size){ :default }
  @position = Array(attribs.delete(:position)).compact
  @hidden = attribs.delete(:hidden) {false}
end

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



7
8
9
# File 'lib/voom/presenters/dsl/components/icon_base.rb', line 7

def color
  @color
end

#hiddenObject (readonly)

Returns the value of attribute hidden.



7
8
9
# File 'lib/voom/presenters/dsl/components/icon_base.rb', line 7

def hidden
  @hidden
end

#iconObject (readonly)

Returns the value of attribute icon.



7
8
9
# File 'lib/voom/presenters/dsl/components/icon_base.rb', line 7

def icon
  @icon
end

#positionObject (readonly)

Returns the value of attribute position.



7
8
9
# File 'lib/voom/presenters/dsl/components/icon_base.rb', line 7

def position
  @position
end

#sizeObject (readonly)

Returns the value of attribute size.



7
8
9
# File 'lib/voom/presenters/dsl/components/icon_base.rb', line 7

def size
  @size
end