struct Athena::Validator::Violation::ConstraintViolationList
inherits Struct
#
Basic implementation of AVD::Violation::ConstraintViolationListInterface.
Included modules
Athena::Validator::Violation::ConstraintViolationListInterface
Indexable
Constructors#
.new(violations : Array(AVD::Violation::ConstraintViolationInterface) = [] of AVD::Violation::ConstraintViolationInterface)#
Methods#
#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 consists only of violations with the provided error_code.
#has?(index : Int) : Bool#
Returns true if a violation exists at the provided index, otherwise false.
#inspect(io : IO) : Nil#
Appends this struct's name and instance variables names and values to the given IO.
struct Point
def initialize(@x : Int32, @y : Int32)
end
end
p1 = Point.new 1, 2
p1.to_s # "Point(@x=1, @y=2)"
p1.inspect # "Point(@x=1, @y=2)"
#set(index : Int, violation : AVD::Violation::ConstraintViolationInterface) : Nil#
Sets the provided violation at the provided index.