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.



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

def initialize(key)
  @key = key
  super
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



55
56
57
# File 'lib/familia/errors.rb', line 55

def key
  @key
end

Instance Method Details

#messageObject



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

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