Skip to content

ComparisonValidator

abstract struct Athena::Validator::Constraints::ComparisonValidator
inherits Athena::Validator::ConstraintValidator

Defines common logic for comparison based constraint validators.

Direct known subclasses

Athena::Validator::Constraints::EqualTo::Validator Athena::Validator::Constraints::GreaterThan::Validator Athena::Validator::Constraints::GreaterThanOrEqual::Validator Athena::Validator::Constraints::LessThan::Validator Athena::Validator::Constraints::LessThanOrEqual::Validator Athena::Validator::Constraints::NotEqualTo::Validator

Methods

abstract #compare_values(actual : _, expected : _) : Bool

Returns true if the provided actual and expected values are compatible, otherwise false.

abstract #error_code : String

Returns the expected error code for self.

#validate(value : _, constraint : AVD::Constraints::AbstractComparison) : Nil

:inherit: