Module: Timezone
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Classes:
| |
Defined in: | lib/timezone.rb, lib/timezone/deprecate.rb, lib/timezone/error.rb, lib/timezone/loader.rb, lib/timezone/lookup.rb, lib/timezone/net_http_client.rb, lib/timezone/nil_zone.rb, lib/timezone/parser.rb, lib/timezone/version.rb, lib/timezone/zone.rb, lib/timezone/lookup/basic.rb, lib/timezone/lookup/geonames.rb, lib/timezone/lookup/google.rb, lib/timezone/lookup/test.rb |
Overview
Main entry point for all timezone related functionality.
Constant Summary
-
VERSION =
# File 'lib/timezone/version.rb', line 4'1.3.27'
Class Method Summary
-
.[](name) ⇒ Timezone::Zone, Timezone::NilZone
Retrieve a timezone by name.
-
.fetch(name, default = :__block) {|name| ... } ⇒ Timezone::Zone, Object
Fetch a timezone by name.
-
.lookup(lat, long, default = :__block) {|name| ... } ⇒ Timezone::Zone, Object
Lookup
a timezone name by (lat, long) and then fetch the timezone object. -
.names ⇒ Array<String>
A list of all timezone names.
Class Method Details
.[](name) ⇒ Timezone::Zone, Timezone::NilZone
Retrieve a timezone by name.
.fetch(name, default = :__block) {|name| ... } ⇒ Timezone::Zone, Object
Fetch a timezone by name.
# File 'lib/timezone.rb', line 42
def self.fetch(name, default = :__block, &block) return ::Timezone::Zone.new(name) if Loader.valid?(name) if block_given? && default != :__block warn('warning: block supersedes default value argument') end return block.call(name) if block_given? return default unless default == :__block raise ::Timezone::Error::InvalidZone end
.lookup(lat, long, default = :__block) {|name| ... } ⇒ Timezone::Zone, Object
::Timezone::Lookup
a timezone name by (lat, long) and then fetch the timezone object.
.names ⇒ Array
<String
>
A list of all timezone names.