Module: GoogleMapsService::TimeZone
- Included in:
- Client
- Defined in:
- lib/google_maps_service/time_zone.rb
Overview
Performs requests to the Google Maps TimeZone API.“”“
Instance Method Summary collapse
-
#timezone(location: nil, timestamp: nil, language: nil) ⇒ Hash
Get time zone for a location on the earth, as well as that location’s time offset from UTC.
Instance Method Details
#timezone(location: nil, timestamp: nil, language: nil) ⇒ Hash
Get time zone for a location on the earth, as well as that location’s time offset from UTC.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/google_maps_service/time_zone.rb', line 21 def timezone(location: nil, timestamp: nil, language: nil) location = GoogleMapsService::Convert.latlng(location) = GoogleMapsService::Convert.time( || Time.now) params = { location: location, timestamp: } params[:language] = language if language return get( "/maps/api/timezone/json", params) end |