Exception: Familia::KeyNotFoundError

Inherits:
NonUniqueKey show all
Defined in:
lib/familia/errors.rb

Overview

Raised when attempting to refresh an object whose key doesn't exist in the database

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ KeyNotFoundError

Returns a new instance of KeyNotFoundError.



52
53
54
55
# File 'lib/familia/errors.rb', line 52

def initialize(key)
  @key = key
  super
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



50
51
52
# File 'lib/familia/errors.rb', line 50

def key
  @key
end

Instance Method Details

#messageObject



57
58
59
# File 'lib/familia/errors.rb', line 57

def message
  "Key not found: #{key}"
end