Exception: TypedCache::CacheMissError

Inherits:
Error
  • Object
show all
Defined in:
lib/typed_cache/errors.rb

Overview

Cache miss (when expecting a value to exist)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ CacheMissError

Returns a new instance of CacheMissError.



62
63
64
65
# File 'lib/typed_cache/errors.rb', line 62

def initialize(key)
  super("Cache miss for key: #{key}")
  @key = key
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



59
60
61
# File 'lib/typed_cache/errors.rb', line 59

def key
  @key
end

Instance Method Details

#cache_miss?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/typed_cache/errors.rb', line 68

def cache_miss?
  true
end