Module: Eztz

Defined in:
lib/eztz.rb,
lib/eztz/client.rb,
lib/eztz/version.rb

Defined Under Namespace

Classes: Client

Constant Summary collapse

VERSION =
"0.0.4"

Class Method Summary collapse

Class Method Details

.timezone(params = {}) ⇒ Hashie::Mash

Gets timezone information for a location on earth, as well as that location's time offset from UTC.

Examples:

Get timezone data

Eztz.timezone(lat: -33.86, lng: 151.20)
=> #<Hashie::Mash dstOffset=3600.0 rawOffset=36000.0 status="OK" timeZoneId="Australia/Sydney" timeZoneName="Australian Eastern Daylight Time">

Options Hash (params):

  • :location (String)

    a comma-separated lat,lng tuple. (eg. “-33.86,151.20”)

  • :lat (String, Float)

    latitude (eg. -33.86)

  • :lng (String, Float)

    longitude (ex. 151.20)

Raises:

  • (ArgumentError)

    if :location or :lat and :lng are not provided

See Also:


19
20
21
# File 'lib/eztz.rb', line 19

def self.timezone(params={})
  Eztz::Client.timezone(params)
end