Skip to content

class Athena::Validator::Violation::ConstraintViolationBuilder(Root)
inherits Reference #

Basic implementation of AVD::Violation::ConstraintViolationBuilderInterface.

Included modules

Athena::Validator::Violation::ConstraintViolationBuilderInterface

Class methods#

.new(violations : AVD::Violation::ConstraintViolationListInterface, constraint : AVD::Constraint?, message : String, parameters : Hash(String, String), root : Root, property_path : String, invalid_value : AVD::Container) #

View source

Methods#

#add : Nil #

Adds the violation to the current AVD::ExecutionContextInterface.

View source

#add_parameter(key : String, value : _) : AVD::Violation::ConstraintViolationBuilderInterface #

Adds a parameter with the provided key and value to the violations' AVD::Violation::ConstraintViolationInterface#parameters. The provided value is stringified via #to_s before being added to the parameters.

Returns self for chaining.

View source

#set_parameters(parameters : Hash(String, String)) : AVD::Violation::ConstraintViolationBuilderInterface #

Overrides the entire AVD::Violation::ConstraintViolationInterface#parameters hash with the provided parameters.

Returns self for chaining.

View source