Class: Barometer::Query::Service::GeonamesTimezone::Api

Inherits:
Utils::Api
  • Object
show all
Defined in:
lib/barometer/query/services/apis/geonames_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/geonames_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/geonames_timezone.rb', line 15

def params
  { lat: @latitude, lng: @longitude }
end

#unwrap_nodesObject



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

def unwrap_nodes
  ['geonames', 'timezone']
end

#urlObject



11
12
13
# File 'lib/barometer/query/services/apis/geonames_timezone.rb', line 11

def url
  'http://ws.geonames.org/timezone'
end