Sha256: 68089720428211b07c54369047a4129183fd9a69516af2bbaa2faa4a6bd8be89

Contents?: true

Size: 960 Bytes

Versions: 8

Compression:

Stored size: 960 Bytes

Contents

module Barometer
  module WeatherService
    class WundergroundV1
      class Response
        class Location < WeatherService::Response::Location
          private

          def name
            payload.fetch('display_location', 'full')
          end

          def city
            payload.fetch('display_location', 'city')
          end

          def state_code
            payload.fetch('display_location', 'state')
          end

          def state_name
            payload.fetch('display_location', 'state_name')
          end

          def zip_code
            payload.fetch('display_location', 'zip')
          end

          def country_code
            payload.fetch('display_location', 'country')
          end

          def latitude
            payload.fetch('display_location', 'latitude')
          end

          def longitude
            payload.fetch('display_location', 'longitude')
          end
        end
      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/response/location.rb
barometer-0.9.6 lib/barometer/weather_services/wunderground_v1/response/location.rb
barometer-0.9.5 lib/barometer/weather_services/wunderground_v1/response/location.rb
barometer-0.9.4 lib/barometer/weather_services/wunderground_v1/response/location.rb
barometer-0.9.3 lib/barometer/weather_services/wunderground_v1/response/location.rb
barometer-0.9.2 lib/barometer/weather_services/wunderground_v1/response/location.rb
barometer-0.9.1 lib/barometer/weather_services/wunderground_v1/response/location.rb
barometer-0.9.0 lib/barometer/weather_services/wunderground_v1/response/location.rb