Exception: MultiparameterAttributesHandler::AttributeAssignmentError

Inherits:
MultiparameterAttributesHandlerError show all
Defined in:
lib/multiparameter_attributes_handler/multiparameter_attributes_handler_error.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception_raised, attribute_name) ⇒ AttributeAssignmentError

Returns a new instance of AttributeAssignmentError.



13
14
15
16
# File 'lib/multiparameter_attributes_handler/multiparameter_attributes_handler_error.rb', line 13

def initialize(exception_raised, attribute_name)
  @exception_raised = exception_raised
  @attribute_name = attribute_name
end

Instance Attribute Details

#attribute_nameObject (readonly)

Returns the value of attribute attribute_name.



12
13
14
# File 'lib/multiparameter_attributes_handler/multiparameter_attributes_handler_error.rb', line 12

def attribute_name
  @attribute_name
end

#exception_raisedObject (readonly)

Returns the value of attribute exception_raised.



12
13
14
# File 'lib/multiparameter_attributes_handler/multiparameter_attributes_handler_error.rb', line 12

def exception_raised
  @exception_raised
end