Exception: DuckRecord::AttributeAssignmentError

Inherits:
DuckRecordError
  • Object
show all
Defined in:
lib/duck_record/errors.rb

Overview

Raised when an error occurred while doing a mass assignment to an attribute through the DuckRecord::Base#attributes= method. The exception has an attribute property that is the name of the offending attribute.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, exception = nil, attribute = nil) ⇒ AttributeAssignmentError

Returns a new instance of AttributeAssignmentError.



49
50
51
52
53
# File 'lib/duck_record/errors.rb', line 49

def initialize(message = nil, exception = nil, attribute = nil)
  super(message)
  @exception = exception
  @attribute = attribute
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



47
48
49
# File 'lib/duck_record/errors.rb', line 47

def attribute
  @attribute
end

#exceptionObject (readonly)

Returns the value of attribute exception.



47
48
49
# File 'lib/duck_record/errors.rb', line 47

def exception
  @exception
end