Class: Barometer::WeatherService::Yahoo::Response::ForecastedWeather
- Inherits:
-
Object
- Object
- Barometer::WeatherService::Yahoo::Response::ForecastedWeather
- Defined in:
- lib/barometer/weather_services/yahoo/response/forecasted_weather.rb
Instance Method Summary collapse
-
#initialize(payload, timezone, current_sun) ⇒ ForecastedWeather
constructor
A new instance of ForecastedWeather.
- #parse ⇒ Object
Constructor Details
#initialize(payload, timezone, current_sun) ⇒ ForecastedWeather
Returns a new instance of ForecastedWeather.
6 7 8 9 10 11 |
# File 'lib/barometer/weather_services/yahoo/response/forecasted_weather.rb', line 6 def initialize(payload, timezone, current_sun) @payload = payload @timezone = timezone @current_sun = current_sun @predictions = Barometer::Response::PredictionCollection.new end |
Instance Method Details
#parse ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/barometer/weather_services/yahoo/response/forecasted_weather.rb', line 13 def parse each_prediction do |prediction, forecast_payload| prediction.date = date(forecast_payload), timezone prediction.icon = icon(forecast_payload) prediction.condition = condition(forecast_payload) prediction.high = high(forecast_payload) prediction.low = low(forecast_payload) prediction.sun = sun(forecast_payload, prediction.starts_at, prediction.ends_at) end predictions end |