Class: Knight::Rule::Presence
- Inherits:
-
Knight::Rule
- Object
- Knight::Rule
- Knight::Rule::Presence
- Defined in:
- lib/knight/rule/presence.rb
Overview
A rule for checking the presence of a value
Constant Summary collapse
- DEFAULT_MESSAGE =
"%{attribute} can't be blank".freeze
Instance Attribute Summary
Attributes inherited from Knight::Rule
#attribute_name, #message, #options
Instance Method Summary collapse
-
#matches?(value) ⇒ true, false
private
Check the presence of a value.
Methods inherited from Knight::Rule
Constructor Details
This class inherits a constructor from Knight::Rule
Instance Method Details
#matches?(value) ⇒ true, false
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Check the presence of a value
18 19 20 |
# File 'lib/knight/rule/presence.rb', line 18 def matches?(value) !blank?(value) end |