Class: Barometer::Noaa::Response::ForecastedWeather
- Inherits:
-
Object
- Object
- Barometer::Noaa::Response::ForecastedWeather
- Defined in:
- lib/barometer/noaa/response/forecasted_weather.rb
Instance Method Summary collapse
-
#initialize(payload) ⇒ ForecastedWeather
constructor
A new instance of ForecastedWeather.
- #parse ⇒ Object
Constructor Details
#initialize(payload) ⇒ ForecastedWeather
Returns a new instance of ForecastedWeather.
5 6 7 8 |
# File 'lib/barometer/noaa/response/forecasted_weather.rb', line 5 def initialize(payload) @payload = payload @predictions = Barometer::Response::PredictionCollection.new end |
Instance Method Details
#parse ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/barometer/noaa/response/forecasted_weather.rb', line 10 def parse each_prediction do |prediction, index, shared_index| prediction.starts_at = start_times[index] prediction.ends_at = end_times[index] prediction.icon = icons[shared_index] prediction.condition = summaries[shared_index] prediction.pop = precipitations[index] prediction.high = [:imperial, high_temperatures[shared_index]] prediction.low = [:imperial, low_temperatures[shared_index]] end predictions end |