Class: MudisConfig

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeMudisConfig



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

#bucketsObject

Returns the value of attribute buckets.



6
7
8
# File 'lib/mudis_config.rb', line 6

def buckets
  @buckets
end

#compressObject

Returns the value of attribute compress.



6
7
8
# File 'lib/mudis_config.rb', line 6

def compress
  @compress
end

#default_ttlObject

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_limitObject

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_bytesObject

Returns the value of attribute max_bytes.



6
7
8
# File 'lib/mudis_config.rb', line 6

def max_bytes
  @max_bytes
end

#max_ttlObject

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_bytesObject

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

#serializerObject

Returns the value of attribute serializer.



6
7
8
# File 'lib/mudis_config.rb', line 6

def serializer
  @serializer
end