Class: Weatherman::Image
- Inherits:
-
Object
- Object
- Weatherman::Image
- Defined in:
- lib/yahoo_weatherman/image.rb
Overview
Image
A hash-like object with the weather image attributes (width, height, url, etc..)
Instance Method Summary collapse
- #[](attr) ⇒ Object
-
#initialize(doc) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(doc) ⇒ Image
Returns a new instance of Image.
8 9 10 |
# File 'lib/yahoo_weatherman/image.rb', line 8 def initialize(doc) @image_root = doc end |
Instance Method Details
#[](attr) ⇒ Object
12 13 14 |
# File 'lib/yahoo_weatherman/image.rb', line 12 def [](attr) @image_root.xpath(attr).first.content end |