Exception: Tap::Support::Validation::ValidationError

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

Overview

Raised when Validation blocks fail.

Instance Method Summary collapse

Constructor Details

#initialize(input, validations) ⇒ ValidationError

Returns a new instance of ValidationError.



30
31
32
33
34
35
36
37
38
# File 'lib/tap/support/validation.rb', line 30

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