Exception: MappedRecord::CollisionError

Inherits:
MappingError
  • Object
show all
Defined in:
lib/mapped-record.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mapping_name, key, value, collisions) ⇒ CollisionError

Returns a new instance of CollisionError.



42
43
44
45
# File 'lib/mapped-record.rb', line 42

def initialize(mapping_name, key, value, collisions)
  targets = collisions.map { |c| c.first } << key
  @message = "Collision: #{targets.join(', ')} map to '#{value}'"
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



41
42
43
# File 'lib/mapped-record.rb', line 41

def message
  @message
end