Class: Lab42::CheckedClass::ConstraintChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/lab42/checked_class/constraint_checker.rb

Instance Method Summary collapse

Instance Method Details

#check!(subject) ⇒ Object

Raises:



8
9
10
11
12
13
# File 'lib/lab42/checked_class/constraint_checker.rb', line 8

def check!(subject)
  errors = check(subject)
  return if errors.empty?

  raise ConstraintError, errors.join("\n")
end