Exception: Rails::DataMapper::MultiparameterAssignmentError
- Inherits:
-
StandardError
- Object
- StandardError
- Rails::DataMapper::MultiparameterAssignmentError
- Defined in:
- lib/dm-rails/multiparameter_attributes.rb
Overview
Encapsulates an error of a multiparameter assignment.
Instance Attribute Summary collapse
-
#attribute ⇒ String
readonly
Gets the target attribute of the assignment.
-
#exception ⇒ Exception
readonly
Gets the exception raised on the assignment.
-
#values ⇒ Array
readonly
Gets the assigned values.
Instance Method Summary collapse
-
#initialize(attribute, values, exception) ⇒ MultiparameterAssignmentError
constructor
Initializes a new instance of the MultiparameterAssignmentError class.
Constructor Details
#initialize(attribute, values, exception) ⇒ MultiparameterAssignmentError
Initializes a new instance of the Rails::DataMapper::MultiparameterAssignmentError class.
24 25 26 27 28 29 |
# File 'lib/dm-rails/multiparameter_attributes.rb', line 24 def initialize(attribute, values, exception) super("Could not assign #{values.inspect} to #{attribute} (#{exception.}).") @attribute = attribute @values = values @exception = exception end |
Instance Attribute Details
#attribute ⇒ String (readonly)
Gets the target attribute of the assignment.
9 10 11 |
# File 'lib/dm-rails/multiparameter_attributes.rb', line 9 def attribute @attribute end |
#exception ⇒ Exception (readonly)
Gets the exception raised on the assignment.
17 18 19 |
# File 'lib/dm-rails/multiparameter_attributes.rb', line 17 def exception @exception end |
#values ⇒ Array (readonly)
Gets the assigned values.
13 14 15 |
# File 'lib/dm-rails/multiparameter_attributes.rb', line 13 def values @values end |