Class: Optify::CacheOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/optify_ruby/implementation.rb,
sig/optify.rbs

Overview

Options for caching.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize^(::Array[untyped] key, untyped value, bool is_cache_hit) - #initialize(on_cache_event:) ⇒ void

Returns a new instance of CacheOptions.

Overloads:

  • #initialize^(::Array[untyped] key, untyped value, bool is_cache_hit) -

    Returns void, nil].

  • #initialize(on_cache_event:) ⇒ void

    Parameters:

    • on_cache_event: ((^(::Array[untyped] key, untyped value, bool is_cache_hit) -> void)

      ? on_cache_event]

Signature:

  • (

  • ?on_cache_event: (^(Array[untyped] key, untyped value, bool is_cache_hit) -> void)?,

  • ) -> void



21
22
23
# File 'lib/optify_ruby/implementation.rb', line 21

def initialize(on_cache_event: nil)
  @on_cache_event = on_cache_event
end

Instance Attribute Details

#on_cache_eventObject

Signature:

  • (^(Array[untyped] key, untyped value, bool is_cache_hit) -> void)?



16
17
18
# File 'lib/optify_ruby/implementation.rb', line 16

def on_cache_event
  @on_cache_event
end