module Athena::Validator::Violation::ConstraintViolationBuilderInterface
Overview
A Builder Pattern type for building AVD::Violation::ConstraintViolationInterface
s.
Allows using the methods defined on self
to construct the desired violation before adding it to the context.
Direct including types
Defined in:
violation/constraint_violation_builder_interface.crInstance Method Summary
-
#add : Nil
Adds the violation to the current
AVD::ExecutionContextInterface
. -
#add_parameter(key : String, value : _) : AVD::Violation::ConstraintViolationBuilderInterface
Adds a parameter with the provided key and value to the violations'
AVD::Violation::ConstraintViolationInterface#parameters
. - #at_path(path : String) : AVD::Violation::ConstraintViolationBuilderInterface
- #cause(cause : String | Nil) : AVD::Violation::ConstraintViolationBuilderInterface
- #code(code : String | Nil) : AVD::Violation::ConstraintViolationBuilderInterface
- #constraint(constraint : AVD::Constraint | Nil) : AVD::Violation::ConstraintViolationBuilderInterface
- #invalid_value(value : _) : AVD::Violation::ConstraintViolationBuilderInterface
- #plural(number : Int32) : AVD::Violation::ConstraintViolationBuilderInterface
-
#set_parameters(parameters : Hash(String, String)) : AVD::Violation::ConstraintViolationBuilderInterface
Overrides the entire
AVD::Violation::ConstraintViolationInterface#parameters
hash with the provided parameters.
Instance Method Detail
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.
Sets the AVD::Violation::ConstraintViolationInterface#property_path
.
Returns self
for chaining.
Sets the AVD::Violation::ConstraintViolationInterface#cause
Returns self
for chaining.
Sets the AVD::Violation::ConstraintViolationInterface#code
Returns self
for chaining.
Sets the AVD::Violation::ConstraintViolationInterface#constraint
Returns self
for chaining.
Sets the AVD::Violation::ConstraintViolationInterface#invalid_value
Returns self
for chaining.
Sets AVD::Violation::ConstraintViolationInterface#plural
Returns self
for chaining.
Overrides the entire AVD::Violation::ConstraintViolationInterface#parameters
hash with the provided parameters.
Returns self
for chaining.