class AFCSalesforce::Tools::Validation::Rule::NotEmpty

Rule for not empty

Public Instance Methods

error(value) click to toggle source
# File lib/afc_salesforce/tools/validation/rule/not_empty.rb, line 12
def error(value)
  results            = {}
  results[:expected] =  true
  results[:got]      =  valid_value?(value)
  results
end
error_key() click to toggle source

The error key for this field

# File lib/afc_salesforce/tools/validation/rule/not_empty.rb, line 25
def error_key
  :not_empty
end
params() click to toggle source

This rule has no params

# File lib/afc_salesforce/tools/validation/rule/not_empty.rb, line 8
def params
  {}
end
valid_value?(value) click to toggle source

Determines if value is empty or not. In this rule, nil is empty

# File lib/afc_salesforce/tools/validation/rule/not_empty.rb, line 20
def valid_value?(value)
  ! (value.nil? || value.empty?)
end