Class: Aequitas::Rule::Presence::NotNil
- Inherits:
-
Aequitas::Rule::Presence
- Object
- Aequitas::Rule
- Aequitas::Rule::Presence
- Aequitas::Rule::Presence::NotNil
- Defined in:
- lib/aequitas/rule/presence/not_nil.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/presence/not_nil.rb', line 10 def valid?(resource) !attribute_value(resource).nil? end |
#violation_type(resource) ⇒ Object
14 15 16 |
# File 'lib/aequitas/rule/presence/not_nil.rb', line 14 def violation_type(resource) :nil end |