Class: Barometer::WeatherService::WeatherBug::CurrentApi
- Inherits:
-
Utils::Api
- Object
- Utils::Api
- Barometer::WeatherService::WeatherBug::CurrentApi
- Defined in:
- lib/barometer/weather_services/weather_bug/current_api.rb
Instance Attribute Summary
Attributes inherited from Utils::Api
Instance Method Summary collapse
-
#initialize(query, api_code) ⇒ CurrentApi
constructor
A new instance of CurrentApi.
- #params ⇒ Object
- #unwrap_nodes ⇒ Object
- #url ⇒ Object
Methods inherited from Utils::Api
Constructor Details
#initialize(query, api_code) ⇒ CurrentApi
Returns a new instance of CurrentApi.
7 8 9 10 |
# File 'lib/barometer/weather_services/weather_bug/current_api.rb', line 7 def initialize(query, api_code) @query = WeatherBug::Query.new(query) @api_code = api_code end |
Instance Method Details
#params ⇒ Object
16 17 18 |
# File 'lib/barometer/weather_services/weather_bug/current_api.rb', line 16 def params {ACode: @api_code, OutputType: '1'}.merge(@query.to_param) end |
#unwrap_nodes ⇒ Object
20 21 22 |
# File 'lib/barometer/weather_services/weather_bug/current_api.rb', line 20 def unwrap_nodes ['weather', 'ob'] end |
#url ⇒ Object
12 13 14 |
# File 'lib/barometer/weather_services/weather_bug/current_api.rb', line 12 def url "http://#{@api_code}.api.wxbug.net/getLiveWeatherRSS.aspx" end |