Sha256: 5110d3f7d9f0e0804507be67f63f8f8c5e9b548b7935646728872e9d1656db39

Contents?: true

Size: 850 Bytes

Versions: 8

Compression:

Stored size: 850 Bytes

Contents

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

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

        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

        private

        attr_reader :response
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
barometer-0.9.7 lib/barometer/weather_services/wunderground_v1/current_response.rb
barometer-0.9.6 lib/barometer/weather_services/wunderground_v1/current_response.rb
barometer-0.9.5 lib/barometer/weather_services/wunderground_v1/current_response.rb
barometer-0.9.4 lib/barometer/weather_services/wunderground_v1/current_response.rb
barometer-0.9.3 lib/barometer/weather_services/wunderground_v1/current_response.rb
barometer-0.9.2 lib/barometer/weather_services/wunderground_v1/current_response.rb
barometer-0.9.1 lib/barometer/weather_services/wunderground_v1/current_response.rb
barometer-0.9.0 lib/barometer/weather_services/wunderground_v1/current_response.rb