abstract class Quartz::Verifiers::EachChecker

Overview

EachChecker is a verifier which iterates through the given attributes invoking the #check_each method passing in the model, attribute and value.

All provided verifiers are built on top of this verifier.

Direct Known Subclasses

Defined in:

quartz/verifiers/checker.cr

Constructors

Instance Method Summary

Instance methods inherited from class Quartz::Verifiers::RuntimeChecker

check(model) : Bool check, contexts : Array(Symbol)? contexts, strict? : Bool strict?

Constructor methods inherited from class Quartz::Verifiers::RuntimeChecker

new(**kwargs) new

Instance methods inherited from class Reference

==(other : Quartz::Any) ==

Instance methods inherited from class Object

===(other : Quartz::Any) ===

Constructor Detail

def self.new(*attributes : Symbol, **kwargs) #

Returns a new verifier instance. The given attributes are made available through the #attributes getter.


[View source]

Instance Method Detail

def allow_nil? : Bool #

[View source]
def attributes : Array(Symbol) #

[View source]
def check(model) : Bool #

Performs verification on the supplied model. By default this will call #check_each to determine validity therefore subclasses should override #check_each with verification logic.


[View source]
abstract def check_each(model, attribute, value) #

Override this method in subclasses with the verification logic, adding errors to the records errors array where necessary.


[View source]