Exception: AutomationObject::BluePrint::HashAdapter::ValidationError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- AutomationObject::BluePrint::HashAdapter::ValidationError
- Defined in:
- lib/automation_object/blue_print/hash_adapter/helpers/validation_error.rb
Overview
ValidatorError exception class Allows for multiple errors at one time to allow for better debugging
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(errors) ⇒ ValidationError
constructor
A new instance of ValidationError.
-
#message ⇒ String
Returns full error message.
Constructor Details
#initialize(errors) ⇒ ValidationError
Returns a new instance of ValidationError
12 13 14 |
# File 'lib/automation_object/blue_print/hash_adapter/helpers/validation_error.rb', line 12 def initialize(errors) @errors = errors.is_a?(Array) ? errors : [errors] end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors
9 10 11 |
# File 'lib/automation_object/blue_print/hash_adapter/helpers/validation_error.rb', line 9 def errors @errors end |
Instance Method Details
#message ⇒ String
Returns full error message
17 18 19 20 21 22 23 24 |
# File 'lib/automation_object/blue_print/hash_adapter/helpers/validation_error.rb', line 17 def = "\nBluePrint::HashAdapter composite validation failed for the following errors:\n" @errors.each do |error| += " - #{error}\n" end + "\n" end |