class Amber::Validators::OptionalRule

Overview

OptionalRule only validates (evaluates block) if the key is present and the value is not blank (see call_predicate).

Defined in:

amber/validators/params.cr

Instance Method Summary

Instance methods inherited from class Amber::Validators::BaseRule

apply(params : Amber::Router::Params) apply, error error, field : String field, predicate : String -> Bool predicate, present : Bool present, value : String | Nil value

Constructor methods inherited from class Amber::Validators::BaseRule

new(field : String | Symbol, msg : String | Nil, allow_blank : Bool = true)
new(field : String | Symbol, msg : String | Nil, allow_blank : Bool = true, &block : String -> Bool)
new

Instance Method Detail

def apply(params : Amber::Router::Params) #

[View source]