Class: Weather::Image
- Inherits:
-
Object
- Object
- Weather::Image
- Defined in:
- lib/weather-api/image.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
the full URL to the image.
Instance Method Summary collapse
-
#initialize(payload) ⇒ Image
constructor
A new instance of Image.
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
#url ⇒ Object (readonly)
the full URL to the image
4 5 6 |
# File 'lib/weather-api/image.rb', line 4 def url @url end |