Sha256: 3b442ec9db9e2a243df80558cc35dc0aff755c22de8bfb5fa694f4574b5f4994

Contents?: true

Size: 785 Bytes

Versions: 5

Compression:

Stored size: 785 Bytes

Contents

require_relative 'response/timezone'
require_relative 'response/current_weather'
require_relative 'response/station'

module Barometer
  module WeatherService
    class WeatherBug
      class CurrentResponse
        def initialize
          @response = Barometer::Response.new
        end

        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

        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/current_response.rb
barometer-0.9.3 lib/barometer/weather_services/weather_bug/current_response.rb
barometer-0.9.2 lib/barometer/weather_services/weather_bug/current_response.rb
barometer-0.9.1 lib/barometer/weather_services/weather_bug/current_response.rb
barometer-0.9.0 lib/barometer/weather_services/weather_bug/current_response.rb