Module: WorldTimeApi
- Defined in:
- lib/world_time_api.rb,
lib/world_time_api/error.rb,
lib/world_time_api/request.rb,
lib/world_time_api/version.rb,
lib/world_time_api/response.rb
Overview
The WorldTimeApi module contains methods for making requests to the World Time API.
Defined Under Namespace
Modules: Request
Constant Summary collapse
- Timezones =
Returns a list of all timezones supported by the World Time API.
-> { Request::Call["/timezone"] }
- Time =
Returns the current time for the specified timezone.
-> (timezone) { Request::Call["/timezone/#{timezone}"] }
- ClientIp =
Returns the current time for the client's IP address, or for the specified IP address if provided.
-> (ip = nil) { Request::Call["/ip#{ip ? "/#{ip}" : ''}"] }
- Error =
Creates an error object with the specified message.
-> () { { error: } }
- VERSION =
The current version number of the WorldTimeApi gem.
"0.1.5"
- Response =
Converts the HTTParty response object into a hash.
-> (response) { JSON.parse(response.body) }