Class: Dry::Validation::BuildErrors
- Inherits:
-
Object
- Object
- Dry::Validation::BuildErrors
- Defined in:
- lib/dry/validation/executor.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
55 56 57 |
# File 'lib/dry/validation/executor.rb', line 55 def path @path end |
Class Method Details
.[](path) ⇒ Object
57 58 59 |
# File 'lib/dry/validation/executor.rb', line 57 def self.[](path) path.nil? || path.empty? ? Flat.new : Nested.new(path) end |
Instance Method Details
#call(result) ⇒ Object
77 78 79 80 81 |
# File 'lib/dry/validation/executor.rb', line 77 def call(result) result .select { |_, r| r.failure? } .map { |name, r| Error.new(error_path(name), r) } end |