Module: Timezone::Lookup
Relationships & Source Files | |
Namespace Children | |
Classes:
| |
Defined in: | lib/timezone/lookup.rb, lib/timezone/lookup/basic.rb, lib/timezone/lookup/geonames.rb, lib/timezone/lookup/google.rb, lib/timezone/lookup/test.rb |
Overview
Configure timezone lookups.
Constant Summary
-
MISSING_LOOKUP =
private
# File 'lib/timezone/lookup.rb', line 13'No lookup configured'
Class Method Summary
-
.config(lookup) {|an| ... } ⇒ #lookup
Configure a lookup object.
-
.lookup ⇒ #lookup
Returns the lookup object.
Class Method Details
.config(lookup) {|an| ... } ⇒ #lookup
Configure a lookup object
# File 'lib/timezone/lookup.rb', line 33
def config(lookup) = OptionSetter.new(lookup) yield( .config) if block_given? @lookup = .make_lookup end
.lookup ⇒ #lookup
Returns the lookup object
# File 'lib/timezone/lookup.rb', line 21
def lookup @lookup || raise(::Timezone::Error::InvalidConfig, MISSING_LOOKUP) end