Class: Timezone::Configure Deprecated
- Inherits:
-
Object
- Object
- Timezone::Configure
- Defined in:
- lib/timezone/configure.rb
Overview
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup::config` instead.
The old way to configure this gem. rubocop:disable Style/ClassVars
Constant Summary collapse
- DEPRECATE =
'[DEPRECATED] `Timezone::Configure` will be removed ' \ 'in the release of the `timezone gem. Use `Timezone::Lookup` ' \ 'instead.'.freeze
Class Method Summary collapse
-
.begin {|_self| ... } ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.default_for_list ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.default_for_list=(*list) ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.geonames_lookup ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.geonames_protocol ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.geonames_protocol=(protocol) ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.geonames_url ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.geonames_url=(url) ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.google_api_key ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.google_api_key=(api_key) ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.google_client_id ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.google_client_id=(client) ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.google_lookup ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.google_protocol ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.google_protocol=(protocol) ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.google_url ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.google_url=(url) ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.http_client ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.http_client=(client) ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.lookup ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.lookup=(lookup) ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.order_list_by ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.order_list_by=(order) ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.protocol ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.replace(what, with = {}) ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.replacements ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.url ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.url=(url) ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.use_google? ⇒ Boolean
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.use_google_enterprise? ⇒ Boolean
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.username ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
-
.username=(username) ⇒ Object
deprecated
Deprecated.
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
Class Method Details
.begin {|_self| ... } ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
216 217 218 219 |
# File 'lib/timezone/configure.rb', line 216 def self.begin Deprecate.call(self, :begin, DEPRECATE) yield self end |
.default_for_list ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
236 237 238 |
# File 'lib/timezone/configure.rb', line 236 def self.default_for_list @@default_list ||= nil end |
.default_for_list=(*list) ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
242 243 244 |
# File 'lib/timezone/configure.rb', line 242 def self.default_for_list=(*list) @@default_list = list.flatten! end |
.geonames_lookup ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
119 120 121 122 |
# File 'lib/timezone/configure.rb', line 119 def self.geonames_lookup @geonames_lookup ||= Timezone::Lookup::Geonames.new(GeonamesConfigMapper.new(self)) end |
.geonames_protocol ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
168 169 170 |
# File 'lib/timezone/configure.rb', line 168 def self.geonames_protocol @@geonames_protocol ||= 'http' end |
.geonames_protocol=(protocol) ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
162 163 164 |
# File 'lib/timezone/configure.rb', line 162 def self.geonames_protocol=(protocol) @@geonames_protocol = protocol end |
.geonames_url ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
126 127 128 |
# File 'lib/timezone/configure.rb', line 126 def self.geonames_url @@geonames_url ||= 'api.geonames.org' end |
.geonames_url=(url) ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
132 133 134 |
# File 'lib/timezone/configure.rb', line 132 def self.geonames_url=(url) @@geonames_url = url end |
.google_api_key ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
18 19 20 |
# File 'lib/timezone/configure.rb', line 18 def self.google_api_key @@google_api_key ||= nil end |
.google_api_key=(api_key) ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
24 25 26 |
# File 'lib/timezone/configure.rb', line 24 def self.google_api_key=(api_key) @@google_api_key = api_key end |
.google_client_id ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
30 31 32 |
# File 'lib/timezone/configure.rb', line 30 def self.google_client_id @@google_client_id ||= nil end |
.google_client_id=(client) ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
36 37 38 |
# File 'lib/timezone/configure.rb', line 36 def self.google_client_id=(client) @@google_client_id = client end |
.google_lookup ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
91 92 93 94 |
# File 'lib/timezone/configure.rb', line 91 def self.google_lookup @google_lookup ||= Timezone::Lookup::Google.new(GoogleConfigMapper.new(self)) end |
.google_protocol ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
180 181 182 |
# File 'lib/timezone/configure.rb', line 180 def self.google_protocol @@google_protocol ||= 'https' end |
.google_protocol=(protocol) ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
174 175 176 |
# File 'lib/timezone/configure.rb', line 174 def self.google_protocol=(protocol) @@google_protocol = protocol end |
.google_url ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
144 145 146 |
# File 'lib/timezone/configure.rb', line 144 def self.google_url @@google_url ||= 'maps.googleapis.com' end |
.google_url=(url) ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
150 151 152 |
# File 'lib/timezone/configure.rb', line 150 def self.google_url=(url) @@google_url = url end |
.http_client ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
192 193 194 |
# File 'lib/timezone/configure.rb', line 192 def self.http_client @@http_client ||= Timezone::NetHTTPClient end |
.http_client=(client) ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
198 199 200 |
# File 'lib/timezone/configure.rb', line 198 def self.http_client=(client) @@http_client = client end |
.lookup ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
60 61 62 63 64 |
# File 'lib/timezone/configure.rb', line 60 def self.lookup return @lookup if @lookup use_google? ? google_lookup : geonames_lookup end |
.lookup=(lookup) ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
54 55 56 |
# File 'lib/timezone/configure.rb', line 54 def self.lookup=(lookup) @lookup = lookup && lookup.new(self) end |
.order_list_by ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
248 249 250 |
# File 'lib/timezone/configure.rb', line 248 def self.order_list_by @@order_by ||= :utc_offset end |
.order_list_by=(order) ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
254 255 256 |
# File 'lib/timezone/configure.rb', line 254 def self.order_list_by=(order) @@order_by = order end |
.protocol ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
186 187 188 |
# File 'lib/timezone/configure.rb', line 186 def self.protocol use_google? ? google_protocol : geonames_protocol end |
.replace(what, with = {}) ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
223 224 225 226 |
# File 'lib/timezone/configure.rb', line 223 def self.replace(what, with = {}) replacements # instantiate @@replacements @@replacements[what] = with[:with] end |
.replacements ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
230 231 232 |
# File 'lib/timezone/configure.rb', line 230 def self.replacements @@replacements ||= {} end |
.url ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
156 157 158 |
# File 'lib/timezone/configure.rb', line 156 def self.url use_google? ? google_url : geonames_url end |
.url=(url) ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
138 139 140 |
# File 'lib/timezone/configure.rb', line 138 def self.url=(url) self.geonames_url = url end |
.use_google? ⇒ Boolean
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
42 43 44 |
# File 'lib/timezone/configure.rb', line 42 def self.use_google? !google_api_key.nil? end |
.use_google_enterprise? ⇒ Boolean
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
48 49 50 |
# File 'lib/timezone/configure.rb', line 48 def self.use_google_enterprise? use_google? && !google_client_id.nil? end |
.username ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
204 205 206 |
# File 'lib/timezone/configure.rb', line 204 def self.username @@username ||= nil end |
.username=(username) ⇒ Object
‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.
210 211 212 |
# File 'lib/timezone/configure.rb', line 210 def self.username=(username) @@username = username end |