Sha256: 369eb59384c6c30a60e34de7bc2402224f87a1b2a45246e9614ac9c9f78b0df4
Contents?: true
Size: 1.28 KB
Versions: 1
Compression:
Stored size: 1.28 KB
Contents
module Timezone # Configuration class for the Timezone gem. # # Timezone::Configure.begin do |c| ... end # # c.username = username - the geonames username you use to access the geonames timezone API. # # Signup for a geonames username at http://www.geonames.org/login. Use that username to configure # your application for latitude and longitude based timezone searches. If you aren't going to # initialize timezone objects based on latitude and longitude then this configuration is not necessary. class Configure def self.url @@url ||= 'ws.geonames.org' end def self.url= url @@url = url end def self.username @@username end def self.username= username @@username = username end def self.begin yield self end def self.replace(what, with = Hash.new) replacements # instantiate @@replacements @@replacements[what] = with[:with] end def self.replacements @@replacements ||= {} end def self.default_for_list @@default_list ||= nil end def self.default_for_list=(*list) @@default_list = list.flatten! end def self.order_list_by @@order_by ||= :utc_offset end def self.order_list_by=(order) @@order_by = order end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
timezone-0.1.4 | lib/timezone/configure.rb |