Class: TZDetect::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/tzdetect/configuration.rb

Constant Summary collapse

ALLOWED_TYPES =
[:google, :geoname]
@@google_signature =
nil
@@google_client_key =
nil

Class Method Summary collapse

Class Method Details

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

Yields:

  • (_self)

Yield Parameters:



42
43
44
# File 'lib/tzdetect/configuration.rb', line 42

def self.begin
  yield self
end

.google_client_keyObject



17
18
19
# File 'lib/tzdetect/configuration.rb', line 17

def self.google_client_key
  @@google_client_key 
end

.google_client_key=(google_key) ⇒ Object



21
22
23
# File 'lib/tzdetect/configuration.rb', line 21

def self.google_client_key= google_key
  @@google_client_key= google_key
end

.google_signatureObject



25
26
27
# File 'lib/tzdetect/configuration.rb', line 25

def self.google_signature
  @@google_signature 
end

.google_signature=(google_signature) ⇒ Object



29
30
31
# File 'lib/tzdetect/configuration.rb', line 29

def self.google_signature= google_signature
  @@google_key= google_signature
end

.serviceObject



13
14
15
# File 'lib/tzdetect/configuration.rb', line 13

def self.service
  @@service ||= :google
end

.service=(type) ⇒ Object

Raises:

  • (ArgumentError)


8
9
10
11
# File 'lib/tzdetect/configuration.rb', line 8

def self.service= type
  raise ArgumentError, "wrong service type" unless ALLOWED_TYPES.include?(type.to_sym)
  @@service= type
end

.usernameObject



38
39
40
# File 'lib/tzdetect/configuration.rb', line 38

def self.username
  @@username 
end

.username=(username) ⇒ Object



34
35
36
# File 'lib/tzdetect/configuration.rb', line 34

def self.username= username
  @@username = username
end