Class: FastExists::Configuration
- Inherits:
-
Object
- Object
- FastExists::Configuration
- Defined in:
- lib/fast_exists/configuration.rb
Instance Attribute Summary collapse
-
#auto_sync ⇒ Object
Returns the value of attribute auto_sync.
-
#backend ⇒ Object
Returns the value of attribute backend.
-
#expected_elements ⇒ Object
Returns the value of attribute expected_elements.
-
#false_positive_rate ⇒ Object
Returns the value of attribute false_positive_rate.
-
#file_path ⇒ Object
Returns the value of attribute file_path.
-
#instrumentation ⇒ Object
Returns the value of attribute instrumentation.
-
#key_prefix ⇒ Object
Returns the value of attribute key_prefix.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#metrics ⇒ Object
Returns the value of attribute metrics.
-
#multi_tenant ⇒ Object
Returns the value of attribute multi_tenant.
-
#redis ⇒ Object
Returns the value of attribute redis.
-
#tenant_strategy ⇒ Object
Returns the value of attribute tenant_strategy.
-
#tenant_thresholds ⇒ Object
Returns the value of attribute tenant_thresholds.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/fast_exists/configuration.rb', line 19 def initialize @backend = :memory @false_positive_rate = 0.001 @expected_elements = 1_000_000 @auto_sync = true @instrumentation = true @metrics = true @redis = nil @file_path = nil @logger = defined?(Rails) && Rails.respond_to?(:logger) ? Rails.logger : nil # Multi-tenant enterprise configuration @multi_tenant = false @tenant_strategy = :adaptive @tenant_thresholds = { tiny: 10_000, small: 100_000, medium: 1_000_000 } @key_prefix = "fast_exists" end |
Instance Attribute Details
#auto_sync ⇒ Object
Returns the value of attribute auto_sync.
5 6 7 |
# File 'lib/fast_exists/configuration.rb', line 5 def auto_sync @auto_sync end |
#backend ⇒ Object
Returns the value of attribute backend.
5 6 7 |
# File 'lib/fast_exists/configuration.rb', line 5 def backend @backend end |
#expected_elements ⇒ Object
Returns the value of attribute expected_elements.
5 6 7 |
# File 'lib/fast_exists/configuration.rb', line 5 def expected_elements @expected_elements end |
#false_positive_rate ⇒ Object
Returns the value of attribute false_positive_rate.
5 6 7 |
# File 'lib/fast_exists/configuration.rb', line 5 def false_positive_rate @false_positive_rate end |
#file_path ⇒ Object
Returns the value of attribute file_path.
5 6 7 |
# File 'lib/fast_exists/configuration.rb', line 5 def file_path @file_path end |
#instrumentation ⇒ Object
Returns the value of attribute instrumentation.
5 6 7 |
# File 'lib/fast_exists/configuration.rb', line 5 def instrumentation @instrumentation end |
#key_prefix ⇒ Object
Returns the value of attribute key_prefix.
5 6 7 |
# File 'lib/fast_exists/configuration.rb', line 5 def key_prefix @key_prefix end |
#logger ⇒ Object
Returns the value of attribute logger.
5 6 7 |
# File 'lib/fast_exists/configuration.rb', line 5 def logger @logger end |
#metrics ⇒ Object
Returns the value of attribute metrics.
5 6 7 |
# File 'lib/fast_exists/configuration.rb', line 5 def metrics @metrics end |
#multi_tenant ⇒ Object
Returns the value of attribute multi_tenant.
5 6 7 |
# File 'lib/fast_exists/configuration.rb', line 5 def multi_tenant @multi_tenant end |
#redis ⇒ Object
Returns the value of attribute redis.
5 6 7 |
# File 'lib/fast_exists/configuration.rb', line 5 def redis @redis end |
#tenant_strategy ⇒ Object
Returns the value of attribute tenant_strategy.
5 6 7 |
# File 'lib/fast_exists/configuration.rb', line 5 def tenant_strategy @tenant_strategy end |
#tenant_thresholds ⇒ Object
Returns the value of attribute tenant_thresholds.
5 6 7 |
# File 'lib/fast_exists/configuration.rb', line 5 def tenant_thresholds @tenant_thresholds end |
Instance Method Details
#reset! ⇒ Object
41 42 43 |
# File 'lib/fast_exists/configuration.rb', line 41 def reset! initialize end |