Exception: Configurable::Validation::ValidationError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/configurable/validation.rb

Overview

Raised when a Validation block fails.

Instance Method Summary collapse

Constructor Details

#initialize(input, validations) ⇒ ValidationError

Returns a new instance of ValidationError.



33
34
35
36
37
38
39
40
# File 'lib/configurable/validation.rb', line 33

def initialize(input, validations)
  super case 
  when validations.empty?
    "no validations specified"
  else
    "expected #{validations.inspect} but was: #{input.inspect}"
  end
end