Class: Hamweather::Forecast::Daily
- Inherits:
-
Object
- Object
- Hamweather::Forecast::Daily
- Defined in:
- lib/hamweather/forecast/daily.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root.
-
#day ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root.
-
#detail ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root.
-
#expected_weather ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root.
-
#high_celsius ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root.
-
#high_farenheit ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root.
-
#hours ⇒ Object
Returns the value of attribute hours.
-
#low_celsius ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root.
-
#low_farenheit ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root.
-
#probability_of_preciptiation ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root.
Instance Method Summary collapse
- #each_hour ⇒ Object
-
#initialize(daily_forecast) ⇒ Daily
constructor
A new instance of Daily.
Constructor Details
#initialize(daily_forecast) ⇒ Daily
Returns a new instance of Daily.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/hamweather/forecast/daily.rb', line 7 def initialize(daily_forecast) @hours = {} @high_farenheit = daily_forecast[:hif].to_i @high_celsius = daily_forecast[:hic].to_i @low_farenheit = daily_forecast[:lof].to_i @low_celsius = daily_forecast[:loc].to_i @date = Date.parse(daily_forecast[:date]) @expected_weather = daily_forecast[:wx] @detail = daily_forecast[:detail] @probability_of_preciptiation = daily_forecast[:pop].to_i end |
Instance Attribute Details
#date ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root
4 5 6 |
# File 'lib/hamweather/forecast/daily.rb', line 4 def date @date end |
#day ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root
4 5 6 |
# File 'lib/hamweather/forecast/daily.rb', line 4 def day @day end |
#detail ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root
4 5 6 |
# File 'lib/hamweather/forecast/daily.rb', line 4 def detail @detail end |
#expected_weather ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root
4 5 6 |
# File 'lib/hamweather/forecast/daily.rb', line 4 def expected_weather @expected_weather end |
#high_celsius ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root
4 5 6 |
# File 'lib/hamweather/forecast/daily.rb', line 4 def high_celsius @high_celsius end |
#high_farenheit ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root
4 5 6 |
# File 'lib/hamweather/forecast/daily.rb', line 4 def high_farenheit @high_farenheit end |
#hours ⇒ Object
Returns the value of attribute hours.
5 6 7 |
# File 'lib/hamweather/forecast/daily.rb', line 5 def hours @hours end |
#low_celsius ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root
4 5 6 |
# File 'lib/hamweather/forecast/daily.rb', line 4 def low_celsius @low_celsius end |
#low_farenheit ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root
4 5 6 |
# File 'lib/hamweather/forecast/daily.rb', line 4 def low_farenheit @low_farenheit end |
#probability_of_preciptiation ⇒ Object
daily_forecast = Hpricot.parse(‘<FPeriod interval=“1” Day=“FRI” Date=“2008-11-14” Wx=“Chance T-storms” Icon=“tstorm.gif” HiF=“66” HiC=“19” LoF=“56” LoC=“13” Pop=“60” Detail=“Occasional showers with a chance of thunderstorms. Areas of fog. Some thunderstorms May be severe after midnight. Lows in the mid 50s. South winds 5 to 10 mph shifting to the southwest 10 to 15 mph after midnight. Chance of rain near 100 percent.”/>’).root
4 5 6 |
# File 'lib/hamweather/forecast/daily.rb', line 4 def probability_of_preciptiation @probability_of_preciptiation end |
Instance Method Details
#each_hour ⇒ Object
19 20 21 22 23 |
# File 'lib/hamweather/forecast/daily.rb', line 19 def each_hour @hours.each_pair do |key, value| yield value end end |