Class: Graticule::Geocoder::Geonames
- Defined in:
- lib/graticule/geocoder/geonames.rb
Defined Under Namespace
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
-
#initialize(username) ⇒ Geonames
constructor
A new instance of Geonames.
- #time_zone(location) ⇒ Object
Constructor Details
#initialize(username) ⇒ Geonames
Returns a new instance of Geonames.
6 7 8 9 |
# File 'lib/graticule/geocoder/geonames.rb', line 6 def initialize(username) @url = URI.parse('http://ws.geonames.org/timezone') @username = URI.encode(username) end |
Instance Method Details
#time_zone(location) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/graticule/geocoder/geonames.rb', line 11 def time_zone(location) get :formatted => 'true', :style => 'full', :lat => location.latitude, :lng => location.longitude, :username => @username end |