Class: LIVR::Rules::Common::Required

Inherits:
LIVR::Rule 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(value, user_data, field_results) ⇒ Object


6
7
8
9
# File 'lib/livr/rules/common.rb', line 6

def call(value, user_data, field_results)
  return if value.in?([[], {}])
  "REQUIRED" if value.blank?
end