Class: Riddler::Elements::Image

Inherits:
Riddler::Element show all
Defined in:
lib/riddler/elements/image.rb

Instance Attribute Summary

Attributes inherited from Riddler::Element

#context, #definition

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Riddler::Element

for, inherited, #initialize, subclasses

Methods included from Includeable

#include?, #include_predicate

Constructor Details

This class inherits a constructor from Riddler::Element

Class Method Details

.typeObject



4
5
6
# File 'lib/riddler/elements/image.rb', line 4

def self.type
  "image"
end

Instance Method Details

#altObject



12
13
14
# File 'lib/riddler/elements/image.rb', line 12

def alt
  context.render definition["alt"]
end

#srcObject



8
9
10
# File 'lib/riddler/elements/image.rb', line 8

def src
  context.render definition["src"]
end

#to_hashObject



16
17
18
# File 'lib/riddler/elements/image.rb', line 16

def to_hash
  super.merge alt: alt, src: src
end