Class: Timezone::Configure Deprecated

Inherits:
Object
  • Object
show all
Defined in:
lib/timezone/configure.rb

Overview

Deprecated.

‘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

Class Method Details

.begin {|_self| ... } ⇒ Object

Deprecated.

‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.

Yields:

  • (_self)

Yield Parameters:



216
217
218
219
# File 'lib/timezone/configure.rb', line 216

def self.begin
  Deprecate.call(self, :begin, DEPRECATE)
  yield self
end

.default_for_listObject

Deprecated.

‘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

Deprecated.

‘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_lookupObject

Deprecated.

‘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_protocolObject

Deprecated.

‘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

Deprecated.

‘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_urlObject

Deprecated.

‘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

Deprecated.

‘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_keyObject

Deprecated.

‘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

Deprecated.

‘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_idObject

Deprecated.

‘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

Deprecated.

‘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_lookupObject

Deprecated.

‘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_protocolObject

Deprecated.

‘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

Deprecated.

‘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_urlObject

Deprecated.

‘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

Deprecated.

‘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_clientObject

Deprecated.

‘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

Deprecated.

‘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

.lookupObject

Deprecated.

‘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

Deprecated.

‘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_byObject

Deprecated.

‘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

Deprecated.

‘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

.protocolObject

Deprecated.

‘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

Deprecated.

‘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

.replacementsObject

Deprecated.

‘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

.urlObject

Deprecated.

‘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

Deprecated.

‘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

Deprecated.

‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.

Returns:

  • (Boolean)


42
43
44
# File 'lib/timezone/configure.rb', line 42

def self.use_google?
  !google_api_key.nil?
end

.use_google_enterprise?Boolean

Deprecated.

‘Timezone::Configure` will be removed in the release of the `timezone gem. Use `Timezone::Lookup instead.

Returns:

  • (Boolean)


48
49
50
# File 'lib/timezone/configure.rb', line 48

def self.use_google_enterprise?
  use_google? && !google_client_id.nil?
end

.usernameObject

Deprecated.

‘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

Deprecated.

‘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