Sha256: 16dfdb1d3d6c37c344cee8a19aceff537b0ef0713f5831d4493ad3f2cc7ec8fb

Contents?: true

Size: 629 Bytes

Versions: 5

Compression:

Stored size: 629 Bytes

Contents

require_relative 'response/forecasted_weather'
require_relative 'response/location'

module Barometer
  module WeatherService
    class WeatherBug
      class ForecastResponse
        def initialize(response)
          @response = response
        end

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

          response
        end

        private

        attr_reader :response

        def timezone
          response.timezone
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
barometer-0.9.4 lib/barometer/weather_services/weather_bug/forecast_response.rb
barometer-0.9.3 lib/barometer/weather_services/weather_bug/forecast_response.rb
barometer-0.9.2 lib/barometer/weather_services/weather_bug/forecast_response.rb
barometer-0.9.1 lib/barometer/weather_services/weather_bug/forecast_response.rb
barometer-0.9.0 lib/barometer/weather_services/weather_bug/forecast_response.rb