struct Athena::Validator::Violation::ConstraintViolationList
- Athena::Validator::Violation::ConstraintViolationList
- Struct
- Value
- Object
Overview
Basic implementation of AVD::Violation::ConstraintViolationListInterface
.
Included Modules
- Athena::Validator::Violation::ConstraintViolationListInterface
- Indexable(Athena::Validator::Violation::ConstraintViolationInterface)
Defined in:
violation/constraint_violation_list.crConstructors
Instance Method Summary
-
#add(violation : AVD::Violation::ConstraintViolationInterface) : Nil
Adds the provided violation to
self
. -
#add(violations : AVD::Violation::ConstraintViolationListInterface) : Nil
Adds each of the provided violations to
self
. -
#find_by_code(error_code : String) : AVD::Violation::ConstraintViolationListInterface
Returns a new
AVD::Violation::ConstraintViolationInterface
that conists only of violations with the provided error_code. -
#has?(index : Int) : Bool
Returns
true
if a violation exists at the provided index, otherwisefalse
. -
#remove(index : Int) : Nil
Returns the violation at the provided index.
-
#set(index : Int, violation : AVD::Violation::ConstraintViolationInterface) : Nil
Sets the provided violation at the provided index.
-
#size : Int
Returns the number of elements in this container.
-
#to_json(builder : JSON::Builder) : Nil
Returns a
JSON
representation ofself
. -
#to_s(io : IO) : Nil
Returns a string representation of
self
.
Instance methods inherited from module Athena::Validator::Violation::ConstraintViolationListInterface
add(violation : AVD::Violation::ConstraintViolationInterface) : Niladd(violations : AVD::Violation::ConstraintViolationListInterface) : Nil add, has?(index : Int) : Bool has?, remove(index : Int) : Nil remove, set(index : Int, violation : AVD::Violation::ConstraintViolationInterface) : Nil set, size : Int size, to_json(builder : JSON::Builder) : Nil to_json, to_s(io : IO) : Nil to_s
Constructor Detail
Instance Method Detail
Adds the provided violation to self
.
Adds each of the provided violations to self
.
Returns a new AVD::Violation::ConstraintViolationInterface
that conists only of violations with the provided error_code.
Returns true
if a violation exists at the provided index, otherwise false
.
Sets the provided violation at the provided index.