Exception: MappedRecord::TargetError

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, target = nil, expected = []) ⇒ TargetError

Returns a new instance of TargetError.



32
33
34
35
# File 'lib/mapped-record.rb', line 32

def initialize(mapping_name, key, target = nil, expected = [])
  @message = "Got #{target.class} for target. #{expected.join(' or ')} expected." if target
  @message = "Got #{key.class} for key. #{expected.join(' or ')} expected." unless target
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



31
32
33
# File 'lib/mapped-record.rb', line 31

def message
  @message
end