Class: LIVR::Rules::Common::NotEmptyList

Inherits:
LIVR::Rule
  • Object
show all
Defined in:
lib/livr/rules/common.rb

Instance Method Summary collapse

Methods inherited from LIVR::Rule

#initialize

Constructor Details

This class inherits a constructor from LIVR::Rule

Instance Method Details

#call(list, user_data, field_results) ⇒ Object



19
20
21
22
23
# File 'lib/livr/rules/common.rb', line 19

def call(list, user_data, field_results)
  return "CANNOT_BE_EMPTY" if is_no_value(list)
  return "CANNOT_BE_EMPTY" if list.is_a?(Array) && list.blank?
  return "FORMAT_ERROR" unless list.is_a?(Array)
end