abstract class Athena::Validator::Constraints::Composite

Overview

A constraint composed of other constraints. handles normalizing the groups of the nested constraints, via the following algorithm:

NOTE You most likely want to use AVD::Constraints::Compound instead of this type.

Direct Known Subclasses

Defined in:

constraints/composite.cr

Constructors

Instance Method Summary

Instance methods inherited from class Athena::Validator::Constraint

add_implicit_group(group : String) : Nil add_implicit_group, groups : Array(String) groups, groups=(groups : Array(String)) groups=, message : String message, payload : Hash(String, String) | Nil payload, validated_by : AVD::ConstraintValidator.class validated_by

Constructor methods inherited from class Athena::Validator::Constraint

new(message : String, groups : Array(String) | String | Nil = nil, payload : Hash(String, String) | Nil = nil) new

Class methods inherited from class Athena::Validator::Constraint

error_name(error_code : String) : String error_name

Constructor Detail

def self.new(constraints : Array(AVD::Constraint) | AVD::Constraint, message : String, groups : Array(String) | String | Nil = nil, payload : Hash(String, String) | Nil = nil) #

[View source]

Instance Method Detail

def add_implicit_group(group : String) : Nil #
Description copied from class Athena::Validator::Constraint

Adds the provided group to #groups if self is in the AVD::Constraint::DEFAULT_GROUP.


[View source]
def constraints : Array(AVD::Constraint) #

[View source]