Class: Aequitas::Rule::Absence::Blank
- Inherits:
-
Aequitas::Rule::Absence
- Object
- Aequitas::Rule
- Aequitas::Rule::Absence
- Aequitas::Rule::Absence::Blank
- Defined in:
- lib/aequitas/rule/absence/blank.rb
Instance Attribute Summary
Attributes inherited from Aequitas::Rule
#attribute_name, #custom_message, #guard, #skip_condition
Attributes included from ValueObject
Instance Method Summary collapse
Methods inherited from Aequitas::Rule
#attribute_value, #execute?, #initialize, rules_for, #skip?, #validate, #violation_data, #violation_info, #violation_values
Methods included from ValueObject
Constructor Details
This class inherits a constructor from Aequitas::Rule
Instance Method Details
#valid?(resource) ⇒ Boolean
10 11 12 |
# File 'lib/aequitas/rule/absence/blank.rb', line 10 def valid?(resource) Aequitas.blank?(attribute_value(resource)) end |
#violation_type(resource) ⇒ Object
14 15 16 |
# File 'lib/aequitas/rule/absence/blank.rb', line 14 def violation_type(resource) :not_blank end |