Class: Kangaru::Validators::RequiredValidator

Inherits:
Kangaru::Validator show all
Defined in:
lib/kangaru/validators/required_validator.rb

Constant Summary collapse

MESSAGE =
"can't be blank".freeze

Instance Attribute Summary

Attributes inherited from Kangaru::Validator

#attribute, #model, #params, #value

Instance Method Summary collapse

Methods inherited from Kangaru::Validator

#add_error!, #initialize

Constructor Details

This class inherits a constructor from Kangaru::Validator

Instance Method Details

#validateObject



6
7
8
9
10
# File 'lib/kangaru/validators/required_validator.rb', line 6

def validate
  return unless value_missing?

  add_error!(MESSAGE)
end