Exception: Dry::Types::MultipleError

Inherits:
CoercionError show all
Defined in:
lib/dry/types/errors.rb

Overview

Collection of multiple errors

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from CoercionError

handle

Constructor Details

#initialize(errors) ⇒ MultipleError

Returns a new instance of MultipleError.

Parameters:



53
54
55
56
# File 'lib/dry/types/errors.rb', line 53

def initialize(errors)
  super("")
  @errors = errors
end

Instance Attribute Details

#errorsArray<CoercionError> (readonly)

Returns:



50
51
52
# File 'lib/dry/types/errors.rb', line 50

def errors
  @errors
end

Instance Method Details

#messageObject

Returns string.

Returns:

  • string



59
60
61
# File 'lib/dry/types/errors.rb', line 59

def message
  errors.map(&:message).join(", ")
end

#metaArray

Returns:



64
65
66
# File 'lib/dry/types/errors.rb', line 64

def meta
  errors.map(&:meta)
end