Class: AFCSalesforce::Tools::Validation::Rule::NotNil
- Inherits:
-
Object
- Object
- AFCSalesforce::Tools::Validation::Rule::NotNil
- Defined in:
- lib/afc_salesforce/tools/validation/rule/not_nil.rb
Overview
Rule for not nil
Instance Method Summary collapse
- #error(value) ⇒ Object
-
#error_key ⇒ Object
The error key for this field.
-
#params ⇒ Object
This rule has no params.
-
#valid_value?(value) ⇒ Boolean
Determines if value is nil or not.
Instance Method Details
#error(value) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/afc_salesforce/tools/validation/rule/not_nil.rb', line 12 def error(value) results = {} results[:expected] = true results[:got] = valid_value?(value) results end |
#error_key ⇒ Object
The error key for this field
25 26 27 |
# File 'lib/afc_salesforce/tools/validation/rule/not_nil.rb', line 25 def error_key :not_nil end |
#params ⇒ Object
This rule has no params
8 9 10 |
# File 'lib/afc_salesforce/tools/validation/rule/not_nil.rb', line 8 def params {} end |
#valid_value?(value) ⇒ Boolean
Determines if value is nil or not.
20 21 22 |
# File 'lib/afc_salesforce/tools/validation/rule/not_nil.rb', line 20 def valid_value?(value) !value.nil? end |