Class: UndergroundWeather::Forecast
- Inherits:
-
Object
- Object
- UndergroundWeather::Forecast
- Defined in:
- lib/undergroundweather/features/forecast.rb
Instance Attribute Summary collapse
-
#friday ⇒ Object
readonly
Returns the value of attribute friday.
-
#monday ⇒ Object
readonly
Returns the value of attribute monday.
-
#saturday ⇒ Object
readonly
Returns the value of attribute saturday.
-
#sunday ⇒ Object
readonly
Returns the value of attribute sunday.
-
#thursday ⇒ Object
readonly
Returns the value of attribute thursday.
-
#tuesday ⇒ Object
readonly
Returns the value of attribute tuesday.
-
#wednesday ⇒ Object
readonly
Returns the value of attribute wednesday.
Instance Method Summary collapse
-
#initialize(feed) ⇒ Forecast
constructor
A new instance of Forecast.
Constructor Details
#initialize(feed) ⇒ Forecast
Returns a new instance of Forecast.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/undergroundweather/features/forecast.rb', line 5 def initialize(feed) days = [] feed['forecast']['simpleforecast']['forecastday'].each do |daily| days << DailyForecast.new(daily) end days.each do |d| instance_variable_set("@#{d.day.downcase}", d) end end |
Instance Attribute Details
#friday ⇒ Object (readonly)
Returns the value of attribute friday.
3 4 5 |
# File 'lib/undergroundweather/features/forecast.rb', line 3 def friday @friday end |
#monday ⇒ Object (readonly)
Returns the value of attribute monday.
3 4 5 |
# File 'lib/undergroundweather/features/forecast.rb', line 3 def monday @monday end |
#saturday ⇒ Object (readonly)
Returns the value of attribute saturday.
3 4 5 |
# File 'lib/undergroundweather/features/forecast.rb', line 3 def saturday @saturday end |
#sunday ⇒ Object (readonly)
Returns the value of attribute sunday.
3 4 5 |
# File 'lib/undergroundweather/features/forecast.rb', line 3 def sunday @sunday end |
#thursday ⇒ Object (readonly)
Returns the value of attribute thursday.
3 4 5 |
# File 'lib/undergroundweather/features/forecast.rb', line 3 def thursday @thursday end |
#tuesday ⇒ Object (readonly)
Returns the value of attribute tuesday.
3 4 5 |
# File 'lib/undergroundweather/features/forecast.rb', line 3 def tuesday @tuesday end |
#wednesday ⇒ Object (readonly)
Returns the value of attribute wednesday.
3 4 5 |
# File 'lib/undergroundweather/features/forecast.rb', line 3 def wednesday @wednesday end |