Class: Graticule::Geocoder::Geonames

Inherits:
Base
  • Object
show all
Defined in:
lib/graticule/geocoder/geonames.rb

Defined Under Namespace

Classes: Response, Status

Constant Summary

Constants inherited from Base

Base::USER_AGENT

Instance Method Summary collapse

Constructor Details

#initializeGeonames

Returns a new instance of Geonames.



6
7
8
# File 'lib/graticule/geocoder/geonames.rb', line 6

def initialize
  @url = URI.parse 'http://ws.geonames.org/timezone'
end

Instance Method Details

#time_zone(location) ⇒ Object



10
11
12
# File 'lib/graticule/geocoder/geonames.rb', line 10

def time_zone(location)
  get :formatted => 'true', :style => 'full', :lat => location.latitude, :lng => location.longitude
end