Class: Barometer::Noaa::ForecastResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/barometer/noaa/forecast_response.rb

Instance Method Summary collapse

Constructor Details

#initializeForecastResponse

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