class Schematics::CustomValidator(T)

Overview

Custom validator that wraps a user-provided proc

Defined in:

validators.cr

Constructors

Instance Method Summary

Instance methods inherited from class Schematics::Validator(T)

call(value) : T | Nil call, validate(value, path : String = "root") : ValidationResult validate

Constructor Detail

def self.new(validator_proc : T -> Bool, error_message : String = "custom validation failed") #

[View source]

Instance Method Detail

def call(value) : T | Nil #

[View source]
def validate(value, path : String = "root") : ValidationResult #

[View source]