Class: Barometer::WeatherService::WeatherBug::CurrentResponse
- Inherits:
-
Object
- Object
- Barometer::WeatherService::WeatherBug::CurrentResponse
- Defined in:
- lib/barometer/weather_services/weather_bug/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.
9 10 11 |
# File 'lib/barometer/weather_services/weather_bug/current_response.rb', line 9 def initialize @response = Barometer::Response.new end |
Instance Method Details
#parse(payload) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/barometer/weather_services/weather_bug/current_response.rb', line 13 def parse(payload) response.add_query(payload.query) response.timezone = WeatherBug::Response::TimeZone.new(payload).parse response.current = WeatherBug::Response::CurrentWeather.new(payload, timezone).parse response.station = WeatherBug::Response::Station.new(payload).parse response end |