Class: Voom::Presenters::DSL::Components::Image

Inherits:
EventBase show all
Includes:
Mixins::Tooltips
Defined in:
lib/voom/presenters/dsl/components/image.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 Mixins::YieldTo

#yield_to

Methods included from Serializer

#to_hash

Methods included from Lockable

#lock!, #locked?

Constructor Details

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

Returns a new instance of Image.



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

def initialize(**attribs_, &block)
  super(type: :image, context: context,
        **attribs_, &block)
  @image = attribs.delete(:image)
  @height = attribs.delete(:height)
  @width = attribs.delete(:width)
  @position = Array(attribs.delete(:position)).compact
  @selected = attribs.delete(:selected)
  @url = build_url
  expand!
end

Instance Attribute Details

#heightObject

Returns the value of attribute height.



11
12
13
# File 'lib/voom/presenters/dsl/components/image.rb', line 11

def height
  @height
end

#imageObject

Returns the value of attribute image.



11
12
13
# File 'lib/voom/presenters/dsl/components/image.rb', line 11

def image
  @image
end

#positionObject

Returns the value of attribute position.



11
12
13
# File 'lib/voom/presenters/dsl/components/image.rb', line 11

def position
  @position
end

#selectedObject

Returns the value of attribute selected.



11
12
13
# File 'lib/voom/presenters/dsl/components/image.rb', line 11

def selected
  @selected
end

#urlObject

Returns the value of attribute url.



11
12
13
# File 'lib/voom/presenters/dsl/components/image.rb', line 11

def url
  @url
end

#widthObject

Returns the value of attribute width.



11
12
13
# File 'lib/voom/presenters/dsl/components/image.rb', line 11

def width
  @width
end