Class: Barometer::WeatherService::WundergroundV1::CurrentResponse
- Inherits:
-
Object
- Object
- Barometer::WeatherService::WundergroundV1::CurrentResponse
- Defined in:
- lib/barometer/weather_services/wunderground_v1/current_response.rb
Instance Method Summary collapse
-
#initialize ⇒ CurrentResponse
constructor
A new instance of CurrentResponse.
- #parse(payload) ⇒ Object
Constructor Details
#initialize ⇒ CurrentResponse
Returns a new instance of CurrentResponse.
10 11 12 |
# File 'lib/barometer/weather_services/wunderground_v1/current_response.rb', line 10 def initialize @response = Barometer::Response.new end |
Instance Method Details
#parse(payload) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/barometer/weather_services/wunderground_v1/current_response.rb', line 14 def parse(payload) response.add_query(payload.query) response.current = WundergroundV1::Response::CurrentWeather.new(payload).parse response.station = WundergroundV1::Response::Station.new(payload).parse response.location = WundergroundV1::Response::Location.new(payload).parse response.timezone = WundergroundV1::Response::TimeZone.new(payload).parse response end |