Class: UndergroundWeather::DailyForecast
- Inherits:
-
Object
- Object
- UndergroundWeather::DailyForecast
- Defined in:
- lib/undergroundweather/daily_forecast.rb
Instance Attribute Summary collapse
-
#conditions ⇒ Object
readonly
Returns the value of attribute conditions.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#day ⇒ Object
readonly
Returns the value of attribute day.
-
#high_c ⇒ Object
readonly
Returns the value of attribute high_c.
-
#high_f ⇒ Object
(also: #high)
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
(also: #low)
readonly
Returns the value of attribute low_f.
Instance Method Summary collapse
-
#initialize(forecast) ⇒ DailyForecast
constructor
A new instance of DailyForecast.
Constructor Details
#initialize(forecast) ⇒ DailyForecast
Returns a new instance of DailyForecast.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/undergroundweather/daily_forecast.rb', line 7 def initialize(forecast) @day = forecast['date']['weekday'] @date = Time.at(forecast['date']['epoch'].to_i) @high_f = forecast['high']['fahrenheit'] @high_c = forecast['high']['celsius'] @low_f = forecast['low']['fahrenheit'] @low_c = forecast['low']['celsius'] @conditions = forecast['conditions'] @icon = forecast['icon_url'] end |
Instance Attribute Details
#conditions ⇒ Object (readonly)
Returns the value of attribute conditions.
3 4 5 |
# File 'lib/undergroundweather/daily_forecast.rb', line 3 def conditions @conditions end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
3 4 5 |
# File 'lib/undergroundweather/daily_forecast.rb', line 3 def date @date end |
#day ⇒ Object (readonly)
Returns the value of attribute day.
3 4 5 |
# File 'lib/undergroundweather/daily_forecast.rb', line 3 def day @day end |
#high_c ⇒ Object (readonly)
Returns the value of attribute high_c.
3 4 5 |
# File 'lib/undergroundweather/daily_forecast.rb', line 3 def high_c @high_c end |
#high_f ⇒ Object (readonly) Also known as: high
Returns the value of attribute high_f.
3 4 5 |
# File 'lib/undergroundweather/daily_forecast.rb', line 3 def high_f @high_f end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
3 4 5 |
# File 'lib/undergroundweather/daily_forecast.rb', line 3 def icon @icon end |
#low_c ⇒ Object (readonly)
Returns the value of attribute low_c.
3 4 5 |
# File 'lib/undergroundweather/daily_forecast.rb', line 3 def low_c @low_c end |
#low_f ⇒ Object (readonly) Also known as: low
Returns the value of attribute low_f.
3 4 5 |
# File 'lib/undergroundweather/daily_forecast.rb', line 3 def low_f @low_f end |