Class: Trackdown::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



9
10
11
12
13
14
15
16
17
18
# File 'lib/trackdown/configuration.rb', line 9

def initialize
  @maxmind_license_key = nil
  @maxmind_account_id = nil
  @database_path = defined?(Rails) ? Rails.root.join('db', 'GeoLite2-City.mmdb').to_s : 'db/GeoLite2-City.mmdb'
  @timeout = 3 # seconds
  @pool_size = 5
  @pool_timeout = 3 # seconds
  @memory_mode = MaxMind::DB::MODE_MEMORY
  @reject_private_ips = true
end

Instance Attribute Details

#database_pathObject

Returns the value of attribute database_path.



5
6
7
# File 'lib/trackdown/configuration.rb', line 5

def database_path
  @database_path
end

#maxmind_account_idObject

Returns the value of attribute maxmind_account_id.



5
6
7
# File 'lib/trackdown/configuration.rb', line 5

def 
  @maxmind_account_id
end

#maxmind_license_keyObject

Returns the value of attribute maxmind_license_key.



5
6
7
# File 'lib/trackdown/configuration.rb', line 5

def maxmind_license_key
  @maxmind_license_key
end

#memory_modeObject

Returns the value of attribute memory_mode.



5
6
7
# File 'lib/trackdown/configuration.rb', line 5

def memory_mode
  @memory_mode
end

#pool_sizeObject

Returns the value of attribute pool_size.



5
6
7
# File 'lib/trackdown/configuration.rb', line 5

def pool_size
  @pool_size
end

#pool_timeoutObject

Returns the value of attribute pool_timeout.



5
6
7
# File 'lib/trackdown/configuration.rb', line 5

def pool_timeout
  @pool_timeout
end

#reject_private_ipsObject

Returns the value of attribute reject_private_ips.



5
6
7
# File 'lib/trackdown/configuration.rb', line 5

def reject_private_ips
  @reject_private_ips
end

#timeoutObject

Returns the value of attribute timeout.



5
6
7
# File 'lib/trackdown/configuration.rb', line 5

def timeout
  @timeout
end

Instance Method Details

#reject_private_ips?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/trackdown/configuration.rb', line 20

def reject_private_ips?
  @reject_private_ips
end