Class: Readypulse::ImageType

Inherits:
Object
  • Object
show all
Defined in:
lib/readypulse/image_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#heightObject

Returns the value of attribute height.



4
5
6
# File 'lib/readypulse/image_type.rb', line 4

def height
  @height
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/readypulse/image_type.rb', line 4

def type
  @type
end

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/readypulse/image_type.rb', line 4

def url
  @url
end

#widthObject

Returns the value of attribute width.



4
5
6
# File 'lib/readypulse/image_type.rb', line 4

def width
  @width
end