class Launch::Validators::OptionalRule

Overview

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

Defined in:

launch/validators/params.cr

Instance Method Summary

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

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

Constructor methods inherited from class Launch::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 methods inherited from class Object

blank? blank?, present? present?

Instance Method Detail

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

[View source]