Module: Eztz
- Defined in:
- lib/eztz.rb,
lib/eztz/client.rb,
lib/eztz/errors.rb,
lib/eztz/version.rb,
lib/eztz/response.rb
Overview
Ruby wrapper for the Google Time Zone API.
Defined Under Namespace
Classes: ApiError, Client, TimeZoneResponse
Constant Summary collapse
- VERSION =
"2.0.0"
Class Attribute Summary collapse
-
.api_key ⇒ String
Your application’s API key.
Class Method Summary collapse
-
.client ⇒ Eztz::Client
The Eztz client.
- .configure {|_self| ... } ⇒ Object
-
.timezone(location:, timestamp: Time.now.utc.to_i, language: "en") ⇒ Eztz::TimeZoneResponse
Gets timezone information for a location on earth, as well as that location’s time offset from UTC.
Class Attribute Details
.api_key ⇒ String
Returns Your application’s API key. Api keys can be obtained at developers.google.com/maps/documentation/timezone/get-api-key.
22 23 24 |
# File 'lib/eztz.rb', line 22 def api_key @api_key end |
Class Method Details
.client ⇒ Eztz::Client
The Eztz client
35 36 37 |
# File 'lib/eztz.rb', line 35 def client @client ||= Eztz::Client.new end |
.configure {|_self| ... } ⇒ Object
28 29 30 31 |
# File 'lib/eztz.rb', line 28 def configure yield self true end |
.timezone(location:, timestamp: Time.now.utc.to_i, language: "en") ⇒ Eztz::TimeZoneResponse
Gets timezone information for a location on earth, as well as that location’s time offset from UTC.
62 63 64 65 66 |
# File 'lib/eztz.rb', line 62 def timezone(location:, timestamp: Time.now.utc.to_i, language: "en") client.timezone(location: location, timestamp: , language: language) end |