Class: Weatherboy::Current
- Inherits:
-
Object
- Object
- Weatherboy::Current
- Defined in:
- lib/weatherboy/current.rb
Instance Attribute Summary collapse
-
#dewpoint_c ⇒ Object
readonly
Returns the value of attribute dewpoint_c.
-
#dewpoint_f ⇒ Object
readonly
Returns the value of attribute dewpoint_f.
-
#heat_index_c ⇒ Object
readonly
Returns the value of attribute heat_index_c.
-
#heat_index_f ⇒ Object
readonly
Returns the value of attribute heat_index_f.
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#pressure_in ⇒ Object
readonly
Returns the value of attribute pressure_in.
-
#pressure_mb ⇒ Object
readonly
Returns the value of attribute pressure_mb.
-
#relative_humidity ⇒ Object
readonly
Returns the value of attribute relative_humidity.
-
#temp_c ⇒ Object
readonly
Returns the value of attribute temp_c.
-
#temp_f ⇒ Object
readonly
Returns the value of attribute temp_f.
-
#visibility_km ⇒ Object
readonly
Returns the value of attribute visibility_km.
-
#visibility_mi ⇒ Object
readonly
Returns the value of attribute visibility_mi.
-
#weather ⇒ Object
readonly
Returns the value of attribute weather.
-
#wind_dir ⇒ Object
readonly
Returns the value of attribute wind_dir.
-
#wind_mph ⇒ Object
readonly
Returns the value of attribute wind_mph.
-
#windchill_c ⇒ Object
readonly
Returns the value of attribute windchill_c.
-
#windchill_f ⇒ Object
readonly
Returns the value of attribute windchill_f.
Instance Method Summary collapse
-
#initialize(doc) ⇒ Current
constructor
A new instance of Current.
Constructor Details
#initialize(doc) ⇒ Current
Returns a new instance of Current.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/weatherboy/current.rb', line 7 def initialize(doc) @icon = "http://icons-ecast.wxug.com/graphics/conds/#{doc.elements['current_observation/icon'].text}.gif" @weather = doc.elements['current_observation/weather'].text @temp_f = doc.elements['current_observation/temp_f'].text @temp_c = doc.elements['current_observation/temp_c'].text @relative_humidity = doc.elements['current_observation/relative_humidity'].text @wind_dir = doc.elements['current_observation/wind_dir'].text @wind_mph = doc.elements['current_observation/wind_mph'].text @pressure_mb = doc.elements['current_observation/pressure_mb'].text @pressure_in = doc.elements['current_observation/pressure_in'].text @dewpoint_f = doc.elements['current_observation/dewpoint_f'].text @dewpoint_c = doc.elements['current_observation/dewpoint_c'].text @heat_index_f = doc.elements['current_observation/heat_index_f'].text @heat_index_c = doc.elements['current_observation/heat_index_c'].text @windchill_f = doc.elements['current_observation/windchill_f'].text @windchill_c = doc.elements['current_observation/windchill_c'].text @windchill_c = doc.elements['current_observation/windchill_c'].text @visibility_mi = doc.elements['current_observation/visibility_mi'].text @visibility_km = doc.elements['current_observation/visibility_km'].text end |
Instance Attribute Details
#dewpoint_c ⇒ Object (readonly)
Returns the value of attribute dewpoint_c.
4 5 6 |
# File 'lib/weatherboy/current.rb', line 4 def dewpoint_c @dewpoint_c end |
#dewpoint_f ⇒ Object (readonly)
Returns the value of attribute dewpoint_f.
4 5 6 |
# File 'lib/weatherboy/current.rb', line 4 def dewpoint_f @dewpoint_f end |
#heat_index_c ⇒ Object (readonly)
Returns the value of attribute heat_index_c.
5 6 7 |
# File 'lib/weatherboy/current.rb', line 5 def heat_index_c @heat_index_c end |
#heat_index_f ⇒ Object (readonly)
Returns the value of attribute heat_index_f.
5 6 7 |
# File 'lib/weatherboy/current.rb', line 5 def heat_index_f @heat_index_f end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
4 5 6 |
# File 'lib/weatherboy/current.rb', line 4 def icon @icon end |
#pressure_in ⇒ Object (readonly)
Returns the value of attribute pressure_in.
4 5 6 |
# File 'lib/weatherboy/current.rb', line 4 def pressure_in @pressure_in end |
#pressure_mb ⇒ Object (readonly)
Returns the value of attribute pressure_mb.
4 5 6 |
# File 'lib/weatherboy/current.rb', line 4 def pressure_mb @pressure_mb end |
#relative_humidity ⇒ Object (readonly)
Returns the value of attribute relative_humidity.
4 5 6 |
# File 'lib/weatherboy/current.rb', line 4 def relative_humidity @relative_humidity end |
#temp_c ⇒ Object (readonly)
Returns the value of attribute temp_c.
4 5 6 |
# File 'lib/weatherboy/current.rb', line 4 def temp_c @temp_c end |
#temp_f ⇒ Object (readonly)
Returns the value of attribute temp_f.
4 5 6 |
# File 'lib/weatherboy/current.rb', line 4 def temp_f @temp_f end |
#visibility_km ⇒ Object (readonly)
Returns the value of attribute visibility_km.
5 6 7 |
# File 'lib/weatherboy/current.rb', line 5 def visibility_km @visibility_km end |
#visibility_mi ⇒ Object (readonly)
Returns the value of attribute visibility_mi.
5 6 7 |
# File 'lib/weatherboy/current.rb', line 5 def visibility_mi @visibility_mi end |
#weather ⇒ Object (readonly)
Returns the value of attribute weather.
4 5 6 |
# File 'lib/weatherboy/current.rb', line 4 def weather @weather end |
#wind_dir ⇒ Object (readonly)
Returns the value of attribute wind_dir.
4 5 6 |
# File 'lib/weatherboy/current.rb', line 4 def wind_dir @wind_dir end |
#wind_mph ⇒ Object (readonly)
Returns the value of attribute wind_mph.
4 5 6 |
# File 'lib/weatherboy/current.rb', line 4 def wind_mph @wind_mph end |
#windchill_c ⇒ Object (readonly)
Returns the value of attribute windchill_c.
5 6 7 |
# File 'lib/weatherboy/current.rb', line 5 def windchill_c @windchill_c end |
#windchill_f ⇒ Object (readonly)
Returns the value of attribute windchill_f.
5 6 7 |
# File 'lib/weatherboy/current.rb', line 5 def windchill_f @windchill_f end |