Class: Ea::Qea::Validation::OclConstraintValidator
- Inherits:
-
BaseValidator
- Object
- BaseValidator
- Ea::Qea::Validation::OclConstraintValidator
- Defined in:
- lib/ea/qea/validation/database/ocl_constraint_validator.rb
Overview
Evaluates OCL invariants stored in t_objectconstraint. For each constraint, parse its OCL expression via Ea::Ocl::Parser and evaluate it against the owning object's attribute values. Failures surface as :warning messages — OCL failures aren't structural errors.
Instance Attribute Summary
Attributes inherited from BaseValidator
Instance Method Summary collapse
Methods inherited from BaseValidator
Constructor Details
This class inherits a constructor from Ea::Qea::Validation::BaseValidator
Instance Method Details
#validate ⇒ Object
12 13 14 15 |
# File 'lib/ea/qea/validation/database/ocl_constraint_validator.rb', line 12 def validate constraints = database.collections[:object_constraints] || [] constraints.each { |c| check_constraint(c) } end |