Class: Voom::Presenters::DSL::Components::Avatar

Inherits:
EventBase
  • Object
show all
Includes:
Mixins::Tooltips
Defined in:
lib/voom/presenters/dsl/components/avatar.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::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) ⇒ Avatar

Returns a new instance of Avatar.



14
15
16
17
18
19
20
21
22
# File 'lib/voom/presenters/dsl/components/avatar.rb', line 14

def initialize(**attribs_, &block)
  super(type: :avatar, context: context,
        **attribs_, &block)
  @avatar = attribs.delete(:avatar)
  @color = attribs.delete(:color)
  @size = attribs.delete(:size)
  @position    = Array(attribs.delete(:position)).compact
  expand!
end

Instance Attribute Details

#avatarObject

Returns the value of attribute avatar.



12
13
14
# File 'lib/voom/presenters/dsl/components/avatar.rb', line 12

def avatar
  @avatar
end

#colorObject

Returns the value of attribute color.



12
13
14
# File 'lib/voom/presenters/dsl/components/avatar.rb', line 12

def color
  @color
end

#positionObject

Returns the value of attribute position.



12
13
14
# File 'lib/voom/presenters/dsl/components/avatar.rb', line 12

def position
  @position
end

#sizeObject

Returns the value of attribute size.



12
13
14
# File 'lib/voom/presenters/dsl/components/avatar.rb', line 12

def size
  @size
end