Class: Barometer::Noaa::ForecastResponse
- Inherits:
-
Object
- Object
- Barometer::Noaa::ForecastResponse
- Defined in:
- lib/barometer/noaa/forecast_response.rb
Instance Method Summary collapse
-
#initialize ⇒ ForecastResponse
constructor
A new instance of ForecastResponse.
- #parse(payload) ⇒ Object
Constructor Details
#initialize ⇒ ForecastResponse
Returns a new instance of ForecastResponse.
7 8 9 |
# File 'lib/barometer/noaa/forecast_response.rb', line 7 def initialize @response = Barometer::Response.new end |
Instance Method Details
#parse(payload) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/barometer/noaa/forecast_response.rb', line 11 def parse(payload) response.add_query(payload.query) response.location = Noaa::Response::Location.new(payload).parse response.station = response.location response.forecast = Noaa::Response::ForecastedWeather.new(payload).parse response end |