Class: Trackdown::Configuration
- Inherits:
-
Object
- Object
- Trackdown::Configuration
- Defined in:
- lib/trackdown/configuration.rb
Instance Attribute Summary collapse
-
#database_path ⇒ Object
Returns the value of attribute database_path.
-
#maxmind_account_id ⇒ Object
Returns the value of attribute maxmind_account_id.
-
#maxmind_license_key ⇒ Object
Returns the value of attribute maxmind_license_key.
-
#memory_mode ⇒ Object
Returns the value of attribute memory_mode.
-
#pool_size ⇒ Object
Returns the value of attribute pool_size.
-
#pool_timeout ⇒ Object
Returns the value of attribute pool_timeout.
-
#reject_private_ips ⇒ Object
Returns the value of attribute reject_private_ips.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reject_private_ips? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
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_path ⇒ Object
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_id ⇒ Object
Returns the value of attribute maxmind_account_id.
5 6 7 |
# File 'lib/trackdown/configuration.rb', line 5 def maxmind_account_id @maxmind_account_id end |
#maxmind_license_key ⇒ Object
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_mode ⇒ Object
Returns the value of attribute memory_mode.
5 6 7 |
# File 'lib/trackdown/configuration.rb', line 5 def memory_mode @memory_mode end |
#pool_size ⇒ Object
Returns the value of attribute pool_size.
5 6 7 |
# File 'lib/trackdown/configuration.rb', line 5 def pool_size @pool_size end |
#pool_timeout ⇒ Object
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_ips ⇒ Object
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 |
#timeout ⇒ Object
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
20 21 22 |
# File 'lib/trackdown/configuration.rb', line 20 def reject_private_ips? @reject_private_ips end |