Class: Weatherman::Image

Inherits:
Object
  • Object
show all
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

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