Sha256: 5cc46ca4e32178c7c6f879463c5ba09620a68bf1ccdcf6e45ebc2e3054e24828

Contents?: true

Size: 575 Bytes

Versions: 8

Compression:

Stored size: 575 Bytes

Contents

module Barometer
  module Query
    module Service
      class NoaaStation
        class Api < Utils::Api
          def url
            'http://forecast.weather.gov/MapClick.php'
          end

          def params
            { textField1: latitude, textField2: longitude }
          end

          def get
            Utils::Get.call(url, params).content
          end

          private

          def latitude
            query.q.split(',')[0]
          end

          def longitude
            query.q.split(',')[1]
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
barometer-0.9.7 lib/barometer/query/services/apis/noaa_station.rb
barometer-0.9.6 lib/barometer/query/services/apis/noaa_station.rb
barometer-0.9.5 lib/barometer/query/services/apis/noaa_station.rb
barometer-0.9.4 lib/barometer/query/services/apis/noaa_station.rb
barometer-0.9.3 lib/barometer/query/services/apis/noaa_station.rb
barometer-0.9.2 lib/barometer/query/services/apis/noaa_station.rb
barometer-0.9.1 lib/barometer/query/services/apis/noaa_station.rb
barometer-0.9.0 lib/barometer/query/services/apis/noaa_station.rb