Exception: MappedRecord::TargetError
- Inherits:
-
MappingError
- Object
- StandardError
- MappingError
- MappedRecord::TargetError
- Defined in:
- lib/mapped-record.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(mapping_name, key, target = nil, expected = []) ⇒ TargetError
constructor
A new instance of TargetError.
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
#message ⇒ Object (readonly)
Returns the value of attribute message.
31 32 33 |
# File 'lib/mapped-record.rb', line 31 def @message end |