class AutomationObject::BluePrint::HashAdapter::ValidationError

ValidatorError exception class Allows for multiple errors at one time to allow for better debugging

Attributes

errors[RW]

Public Class Methods

new(errors) click to toggle source

@param errors [Array, String] pass validation error(s) in, class can handle singular or multiple

# 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

Public Instance Methods

message() click to toggle source

@return [String] returns full error message

# File lib/automation_object/blue_print/hash_adapter/helpers/validation_error.rb, line 17
def message
  message = "\nBluePrint::HashAdapter composite validation failed for the following errors:\n"
  @errors.each do |error|
    message += "     - #{error}\n"
  end

  message + "\n"
end