Exception: Familia::IdentifierMismatchError

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

Overview

Raised by Horreum#refresh! when the stored values it assigns would give the object an identifier other than the one that named the key it read. Examples are a stored identifier field that differs from the key, and a stored hash that lacks a field a Proc or method identifier reads. refresh! leaves the object as it was before raising, so it keeps the key it had.

+key+ is the key refresh! read. +resolved_key+ is the key the assigned values resolve to, or nil when they give no identifier.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, resolved_key = nil) ⇒ IdentifierMismatchError

Returns a new instance of IdentifierMismatchError.



66
67
68
69
70
# File 'lib/familia/errors.rb', line 66

def initialize(key, resolved_key = nil)
  @key = key
  @resolved_key = resolved_key
  super(build_message)
end

Instance Attribute Details

#key ⇒ Object (readonly)

Returns the value of attribute key.



64
65
66
# File 'lib/familia/errors.rb', line 64

def key
  @key
end

#resolved_key ⇒ Object (readonly)

Returns the value of attribute resolved_key.



64
65
66
# File 'lib/familia/errors.rb', line 64

def resolved_key
  @resolved_key
end