Class: Barometer::WeatherService::WeatherBug::ForecastResponse

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

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ForecastResponse

Returns a new instance of ForecastResponse.



8
9
10
# File 'lib/barometer/weather_services/weather_bug/forecast_response.rb', line 8

def initialize(response)
  @response = response
end

Instance Method Details

#parse(payload) ⇒ Object



12
13
14
15
16
17
# File 'lib/barometer/weather_services/weather_bug/forecast_response.rb', line 12

def parse(payload)
  response.forecast = WeatherBug::Response::ForecastedWeather.new(payload, timezone).parse
  response.location = WeatherBug::Response::Location.new(payload).parse

  response
end