Class: LIVR::Rules::String::String

Inherits:
LIVR::Rule show all
Defined in:
lib/livr/rules/string.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
10
11
12
13
# File 'lib/livr/rules/string.rb', line 6

def call(value, user_data, field_results)
  return if value.in? [nil, ""]
  return 'FORMAT_ERROR' unless is_primitive(value)

  field_results << value.to_s

  return nil
end