Class: Barometer::WeatherService::Noaa::CurrentResponse

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

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ CurrentResponse

Returns a new instance of CurrentResponse.



10
11
12
# File 'lib/barometer/weather_services/noaa/current_response.rb', line 10

def initialize(response)
  @response = response
end

Instance Method Details

#parse(payload) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/barometer/weather_services/noaa/current_response.rb', line 14

def parse(payload)
  response.timezone = Noaa::Response::TimeZone.new(payload).parse
  response.location = Noaa::Response::CurrentLocation.new(payload, response).parse
  response.station = Noaa::Response::CurrentStation.new(payload, response).parse
  response.current = Noaa::Response::CurrentWeather.new(payload).parse

  response
end