Class: Optify::CacheInitOptions
- Inherits:
-
Object
- Object
- Optify::CacheInitOptions
- Defined in:
- lib/optify_ruby/cache_init_options.rb
Overview
Options for initializing the cache.
Instance Attribute Summary collapse
-
#max_size ⇒ Object
readonly
: Integer?.
-
#mode ⇒ Object
readonly
A value from ‘CacheMode`.
Instance Method Summary collapse
-
#initialize(max_size: nil, mode: CacheMode::NOT_THREAD_SAFE) ⇒ CacheInitOptions
constructor
Initializes the cache options.
Constructor Details
#initialize(max_size: nil, mode: CacheMode::NOT_THREAD_SAFE) ⇒ CacheInitOptions
Initializes the cache options. Defaults to a non-thread-safe unlimited size cache for backwards compatibility with how this library was originally configured with an unbounded hash as the base. : ( | ?max_size: Integer?, | ?mode: Symbol, | ) -> void
33 34 35 36 37 38 39 |
# File 'lib/optify_ruby/cache_init_options.rb', line 33 def initialize( max_size: nil, mode: CacheMode::NOT_THREAD_SAFE ) @max_size = max_size @mode = mode end |
Instance Attribute Details
#max_size ⇒ Object (readonly)
: Integer?
17 18 19 |
# File 'lib/optify_ruby/cache_init_options.rb', line 17 def max_size @max_size end |
#mode ⇒ Object (readonly)
A value from ‘CacheMode`.
: Symbol
22 23 24 |
# File 'lib/optify_ruby/cache_init_options.rb', line 22 def mode @mode end |