Class: Barometer::Query::Service::WundergroundTimezone::Api
- Inherits:
-
Utils::Api
- Object
- Utils::Api
- Barometer::Query::Service::WundergroundTimezone::Api
- Defined in:
- lib/barometer/query/services/apis/wunderground_timezone.rb
Instance Attribute Summary
Attributes inherited from Utils::Api
Instance Method Summary collapse
-
#initialize(latitude, longitude) ⇒ Api
constructor
A new instance of Api.
- #params ⇒ Object
- #unwrap_nodes ⇒ Object
- #url ⇒ Object
Methods inherited from Utils::Api
Constructor Details
#initialize(latitude, longitude) ⇒ Api
Returns a new instance of Api.
6 7 8 9 |
# File 'lib/barometer/query/services/apis/wunderground_timezone.rb', line 6 def initialize(latitude, longitude) @latitude = latitude @longitude = longitude end |
Instance Method Details
#params ⇒ Object
15 16 17 |
# File 'lib/barometer/query/services/apis/wunderground_timezone.rb', line 15 def params { query: "#{@latitude},#{@longitude}" } end |
#unwrap_nodes ⇒ Object
19 20 21 |
# File 'lib/barometer/query/services/apis/wunderground_timezone.rb', line 19 def unwrap_nodes ['forecast', 'simpleforecast', 'forecastday', 0] end |
#url ⇒ Object
11 12 13 |
# File 'lib/barometer/query/services/apis/wunderground_timezone.rb', line 11 def url 'http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml' end |