class LIVR::Rules::Numeric::Decimal

Public Instance Methods

call(value, user_data, field_results) click to toggle source
# File lib/livr/rules/numeric.rb, line 37
def call(value, user_data, field_results)
  return if is_no_value(value)
  return 'FORMAT_ERROR' if !is_primitive(value)

  value_int = Float(value.to_s) rescue nil
  return "NOT_DECIMAL" if value_int.nil?

  field_results << value_int
  return
end