Class: MudisConfig
- Inherits:
-
Object
- Object
- MudisConfig
- Defined in:
- lib/mudis_config.rb
Overview
MudisConfig holds all configuration values for Mudis, and provides defaults that can be overridden via Mudis.configure.
Instance Attribute Summary collapse
-
#buckets ⇒ Object
Returns the value of attribute buckets.
-
#compress ⇒ Object
Returns the value of attribute compress.
-
#default_ttl ⇒ Object
Returns the value of attribute default_ttl.
-
#hard_memory_limit ⇒ Object
Returns the value of attribute hard_memory_limit.
-
#max_bytes ⇒ Object
Returns the value of attribute max_bytes.
-
#max_ttl ⇒ Object
Returns the value of attribute max_ttl.
-
#max_value_bytes ⇒ Object
Returns the value of attribute max_value_bytes.
-
#serializer ⇒ Object
Returns the value of attribute serializer.
Instance Method Summary collapse
-
#initialize ⇒ MudisConfig
constructor
A new instance of MudisConfig.
Constructor Details
#initialize ⇒ MudisConfig
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/mudis_config.rb', line 15 def initialize @serializer = JSON # Default serialization strategy @compress = false # Whether to compress values with Zlib @max_value_bytes = nil # Max size per value (optional) @hard_memory_limit = false # Enforce max_bytes as hard cap @max_bytes = 1_073_741_824 # 1 GB default max cache size @buckets = nil # use nil to signal fallback to ENV or default @max_ttl = nil # Max TTL for cache entries (optional) @default_ttl = nil # Default TTL for cache entries (optional) end |
Instance Attribute Details
#buckets ⇒ Object
Returns the value of attribute buckets.
6 7 8 |
# File 'lib/mudis_config.rb', line 6 def buckets @buckets end |
#compress ⇒ Object
Returns the value of attribute compress.
6 7 8 |
# File 'lib/mudis_config.rb', line 6 def compress @compress end |
#default_ttl ⇒ Object
Returns the value of attribute default_ttl.
6 7 8 |
# File 'lib/mudis_config.rb', line 6 def default_ttl @default_ttl end |
#hard_memory_limit ⇒ Object
Returns the value of attribute hard_memory_limit.
6 7 8 |
# File 'lib/mudis_config.rb', line 6 def hard_memory_limit @hard_memory_limit end |
#max_bytes ⇒ Object
Returns the value of attribute max_bytes.
6 7 8 |
# File 'lib/mudis_config.rb', line 6 def max_bytes @max_bytes end |
#max_ttl ⇒ Object
Returns the value of attribute max_ttl.
6 7 8 |
# File 'lib/mudis_config.rb', line 6 def max_ttl @max_ttl end |
#max_value_bytes ⇒ Object
Returns the value of attribute max_value_bytes.
6 7 8 |
# File 'lib/mudis_config.rb', line 6 def max_value_bytes @max_value_bytes end |
#serializer ⇒ Object
Returns the value of attribute serializer.
6 7 8 |
# File 'lib/mudis_config.rb', line 6 def serializer @serializer end |