Exception: Rails::DataMapper::MultiparameterAssignmentError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/dm-rails/multiparameter_attributes.rb

Overview

Encapsulates an error of a multiparameter assignment.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribute, values, exception) ⇒ MultiparameterAssignmentError

Initializes a new instance of the Rails::DataMapper::MultiparameterAssignmentError class.

Parameters:

  • attribute (String)

    The target attribute of the assignment.

  • values (Array)

    The assigned values.

  • exception (Exception)

    The exception raised on the assignment.



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.message}).")
  @attribute = attribute
  @values = values
  @exception = exception
end

Instance Attribute Details

#attributeString (readonly)

Gets the target attribute of the assignment.

Returns:

  • (String)


9
10
11
# File 'lib/dm-rails/multiparameter_attributes.rb', line 9

def attribute
  @attribute
end

#exceptionException (readonly)

Gets the exception raised on the assignment.

Returns:

  • (Exception)


17
18
19
# File 'lib/dm-rails/multiparameter_attributes.rb', line 17

def exception
  @exception
end

#valuesArray (readonly)

Gets the assigned values.

Returns:

  • (Array)


13
14
15
# File 'lib/dm-rails/multiparameter_attributes.rb', line 13

def values
  @values
end