Sha256: 6b46d084078f1dc87fb5da4faf51567e6cc5fab936efa098de4f75cc2ff3ccca

Contents?: true

Size: 553 Bytes

Versions: 5

Compression:

Stored size: 553 Bytes

Contents

require_relative 'query'

module Barometer
  module WeatherService
    class WeatherBug
      class ForecastApi < Utils::Api
        def initialize(query, api_code)
          @query = WeatherBug::Query.new(query)
          @api_code = api_code
        end

        def url
          "http://#{@api_code}.api.wxbug.net/getForecastRSS.aspx"
        end

        def params
          {ACode: @api_code, OutputType: '1'}.merge(@query.to_param)
        end

        def unwrap_nodes
          ['weather', 'forecasts']
        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_api.rb
barometer-0.9.3 lib/barometer/weather_services/weather_bug/forecast_api.rb
barometer-0.9.2 lib/barometer/weather_services/weather_bug/forecast_api.rb
barometer-0.9.1 lib/barometer/weather_services/weather_bug/forecast_api.rb
barometer-0.9.0 lib/barometer/weather_services/weather_bug/forecast_api.rb