Exception: Stretchy::Errors::ValidationError
- Inherits:
-
StandardError
- Object
- StandardError
- Stretchy::Errors::ValidationError
- Defined in:
- lib/stretchy/errors/validation_error.rb
Instance Method Summary collapse
-
#initialize(errors) ⇒ ValidationError
constructor
A new instance of ValidationError.
- #message ⇒ Object
Constructor Details
#initialize(errors) ⇒ ValidationError
Returns a new instance of ValidationError.
5 6 7 |
# File 'lib/stretchy/errors/validation_error.rb', line 5 def initialize(errors) @errors = errors end |
Instance Method Details
#message ⇒ Object
9 10 11 12 13 |
# File 'lib/stretchy/errors/validation_error.rb', line 9 def @errors.map do |key, err| "Attribute #{key} violated rule #{err[:rule]}" end.join("\n") end |