Exception: Familia::RecordExistsError

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

Overview

Raised when attempting to create an object that already exists in the database

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ RecordExistsError

Returns a new instance of RecordExistsError.



105
106
107
108
# File 'lib/familia/errors.rb', line 105

def initialize(key)
  @key = key
  super
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



103
104
105
# File 'lib/familia/errors.rb', line 103

def key
  @key
end

Instance Method Details

#messageObject



110
111
112
# File 'lib/familia/errors.rb', line 110

def message
  "Key already exists: #{key}"
end