Class: Voom::Presenters::DSL::Components::Badge

Inherits:
EventBase show all
Defined in:
lib/voom/presenters/dsl/components/badge.rb

Instance Attribute Summary collapse

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::Event

#event

Methods inherited from Base

#expand!

Methods included from Mixins::YieldTo

#yield_to

Methods included from Serializer

#to_hash

Methods included from Lockable

#lock!, #locked?

Constructor Details

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

Returns a new instance of Badge.



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

def initialize(**attribs_, &block)
  super(type: :badge, **attribs_, &block)
  @badge = attribs.delete(:badge)
  @icon = attribs.delete(:icon)
  @text = attribs.delete(:text)
  expand!
end

Instance Attribute Details

#badgeObject

Returns the value of attribute badge.



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

def badge
  @badge
end

#iconObject

Returns the value of attribute icon.



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

def icon
  @icon
end

#textObject

Returns the value of attribute text.



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

def text
  @text
end