Class: Weatherboy::Forecast
- Inherits:
-
Object
- Object
- Weatherboy::Forecast
- Defined in:
- lib/weatherboy/forecast.rb
Instance Attribute Summary collapse
-
#conditions ⇒ Object
readonly
Returns the value of attribute conditions.
-
#high_c ⇒ Object
readonly
Returns the value of attribute high_c.
-
#high_f ⇒ Object
readonly
Returns the value of attribute high_f.
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#low_c ⇒ Object
readonly
Returns the value of attribute low_c.
-
#low_f ⇒ Object
readonly
Returns the value of attribute low_f.
-
#pop ⇒ Object
readonly
Returns the value of attribute pop.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
Instance Attribute Details
#conditions ⇒ Object (readonly)
Returns the value of attribute conditions.
4 5 6 |
# File 'lib/weatherboy/forecast.rb', line 4 def conditions @conditions end |
#high_c ⇒ Object (readonly)
Returns the value of attribute high_c.
4 5 6 |
# File 'lib/weatherboy/forecast.rb', line 4 def high_c @high_c end |
#high_f ⇒ Object (readonly)
Returns the value of attribute high_f.
4 5 6 |
# File 'lib/weatherboy/forecast.rb', line 4 def high_f @high_f end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
4 5 6 |
# File 'lib/weatherboy/forecast.rb', line 4 def icon @icon end |
#low_c ⇒ Object (readonly)
Returns the value of attribute low_c.
4 5 6 |
# File 'lib/weatherboy/forecast.rb', line 4 def low_c @low_c end |
#low_f ⇒ Object (readonly)
Returns the value of attribute low_f.
4 5 6 |
# File 'lib/weatherboy/forecast.rb', line 4 def low_f @low_f end |
#pop ⇒ Object (readonly)
Returns the value of attribute pop.
4 5 6 |
# File 'lib/weatherboy/forecast.rb', line 4 def pop @pop end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
4 5 6 |
# File 'lib/weatherboy/forecast.rb', line 4 def text @text end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'lib/weatherboy/forecast.rb', line 4 def title @title end |
Instance Method Details
#first_pass(doc) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/weatherboy/forecast.rb', line 6 def first_pass(doc) @high_f = doc.elements['high/fahrenheit'].text @high_c = doc.elements['high/celsius'].text @low_f = doc.elements['low/fahrenheit'].text @low_c = doc.elements['low/celsius'].text @conditions = doc.elements['conditions'].text @icon = "http://icons-ecast.wxug.com/graphics/conds/#{doc.elements['icon'].text}.gif" @pop = doc.elements['pop'].text end |
#second_pass(doc) ⇒ Object
16 17 18 19 |
# File 'lib/weatherboy/forecast.rb', line 16 def second_pass(doc) @title = doc.elements['title'].text @text = doc.elements['fcttext'].text end |