Class: Weather::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/weather-api/image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ Image

Returns a new instance of Image.



6
7
8
# File 'lib/weather-api/image.rb', line 6

def initialize(payload)
  @url = payload.scan(/src=\"(.*)\"/).flatten.first
end

Instance Attribute Details

#urlObject (readonly)

the full URL to the image



4
5
6
# File 'lib/weather-api/image.rb', line 4

def url
  @url
end