class Amber::Validators::OptionalRule
- Amber::Validators::OptionalRule
- Amber::Validators::BaseRule
- Reference
- Object
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.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