class Amber::Validators::RequiredRule
- Amber::Validators::RequiredRule
- Amber::Validators::BaseRule
- Reference
- Object
Overview
RequiredRule returns false if key is missing or value is blank or if block returns false.
Defined in:
amber/validators/params.crInstance 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