Class WeatherHacks::LWWS::Forecast
In: lib/weatherhacks/lwws.rb
Parent: Object

Methods

new  

Attributes

author  [R] 
celsius  [R] 
copyright  [R] 
day  [R] 
description  [R] 
fahrenheit  [R] 
forecastdate  [R] 
forecastday  [R] 
image  [R] 
link  [R] 
location  [R] 
pinpoints  [R] 
publictime  [R] 
telop  [R] 
title  [R] 

Public Class methods

[Source]

    # File lib/weatherhacks/lwws.rb, line 25
25:     def initialize(doc)
26:       raise ArgumentError, doc unless doc.kind_of? REXML::Document
27:       elt = doc.root.elements["/lwws"]
28:       @author = elt.elements["author"].text
29:       @location = Location.new(elt.elements["location"])
30:       @title = elt.elements["title"].text
31:       @link = URI.parse(elt.elements["link"].text)
32:       @forecastday = elt.elements["forecastday"].text
33:       @day = elt.elements["day"].text
34:       @forecastdate = Time.parse(elt.elements["forecastdate"].text)
35:       @publictime = Time.parse(elt.elements["publictime"].text)
36:       @telop = elt.elements["telop"].text
37:       @description = elt.elements["description"].text
38:       @image = Image.new(elt.elements["image"])
39:       @celsius, @fahrenheit = Temperature.create(elt.elements["temperature"])
40:       @pinpoints = Array.new
41:       elt.elements.collect("pinpoint/location") do |node|
42:         @pinpoints << PinpointLocation.new(node)
43:       end
44:       @copyright = Copyright.new(elt.elements["copyright"])
45:     end

[Validate]