Class: Barometer::WeatherService::Noaa::CurrentResponse
- Inherits:
-
Object
- Object
- Barometer::WeatherService::Noaa::CurrentResponse
- Defined in:
- lib/barometer/weather_services/noaa/current_response.rb
Instance Method Summary collapse
-
#initialize(response) ⇒ CurrentResponse
constructor
A new instance of CurrentResponse.
- #parse(payload) ⇒ Object
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 |