Sha256: 9050479aa01a540007c9361bbf8e3563e7643b1fda14ee4fc317ce215401b434

Contents?: true

Size: 548 Bytes

Versions: 5

Compression:

Stored size: 548 Bytes

Contents

require_relative 'query'

module Barometer
  module WeatherService
    class WeatherBug
      class CurrentApi < 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/getLiveWeatherRSS.aspx"
        end

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

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