struct Athena::Validator::Violation::ConstraintViolationList


Basic implementation of AVD::Violation::ConstraintViolationListInterface.

Included Modules

Defined in:



Instance Method Summary

Instance methods inherited from module Athena::Validator::Violation::ConstraintViolationListInterface

add(violation : AVD::Violation::ConstraintViolationInterface) : Nil
add(violations : AVD::Violation::ConstraintViolationListInterface) : Nil
, 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

def : Array(AVD::Violation::ConstraintViolationInterface) = [] of AVD::Violation::ConstraintViolationInterface) #

[View source]

Instance Method Detail

def add(violation : AVD::Violation::ConstraintViolationInterface) : Nil #

Adds the provided violation to self.

[View source]

Adds each of the provided violations to self.

[View source]
def 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.

[View source]
def has?(index : Int) : Bool #

Returns true if a violation exists at the provided index, otherwise false.

[View source]
def remove(index : Int) : Nil #

Returns the violation at the provided index.

[View source]
def set(index : Int, violation : AVD::Violation::ConstraintViolationInterface) : Nil #

Sets the provided violation at the provided index.

[View source]
def size : Int #

Returns the number of elements in this container.

[View source]
def to_json(builder : JSON::Builder) : Nil #

Returns a JSON representation of self.

[View source]
def to_s(io : IO) : Nil #

Returns a string representation of self.

[View source]