Class: A2z::Responses::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/a2z/responses/image.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#heightObject

Returns the value of attribute height.



4
5
6
# File 'lib/a2z/responses/image.rb', line 4

def height
  @height
end

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/a2z/responses/image.rb', line 4

def url
  @url
end

#widthObject

Returns the value of attribute width.



4
5
6
# File 'lib/a2z/responses/image.rb', line 4

def width
  @width
end

Class Method Details

.from_response(data) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/a2z/responses/image.rb', line 14

def self.from_response(data)
  new.tap do |image|
    image.url = data['URL']
    image.width = data['Width']
    image.height = data['Height']
    image.freeze
  end
end