Class: Readypulse::ImageType
- Inherits:
-
Object
- Object
- Readypulse::ImageType
- Defined in:
- lib/readypulse/image_type.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(raw_type:) ⇒ ImageType
constructor
A new instance of ImageType.
Constructor Details
#initialize(raw_type:) ⇒ ImageType
Returns a new instance of ImageType.
5 6 7 8 9 |
# File 'lib/readypulse/image_type.rb', line 5 def initialize(raw_type:) %w(type url width height).each do |attribute| instance_variable_set( "@" + attribute, raw_type.fetch(attribute.to_sym)) end end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
4 5 6 |
# File 'lib/readypulse/image_type.rb', line 4 def height @height end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/readypulse/image_type.rb', line 4 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/readypulse/image_type.rb', line 4 def url @url end |
#width ⇒ Object
Returns the value of attribute width.
4 5 6 |
# File 'lib/readypulse/image_type.rb', line 4 def width @width end |