Class: Barometer::Query::Service::WundergroundTimezone::Api

Inherits:
Utils::Api
  • Object
show all
Defined in:
lib/barometer/query/services/apis/wunderground_timezone.rb

Instance Attribute Summary

Attributes inherited from Utils::Api

#query

Instance Method Summary collapse

Methods inherited from Utils::Api

#current_query, #get

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

#paramsObject



15
16
17
# File 'lib/barometer/query/services/apis/wunderground_timezone.rb', line 15

def params
  { query: "#{@latitude},#{@longitude}" }
end

#unwrap_nodesObject



19
20
21
# File 'lib/barometer/query/services/apis/wunderground_timezone.rb', line 19

def unwrap_nodes
  ['forecast', 'simpleforecast', 'forecastday', 0]
end

#urlObject



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