Class: ThePlaidApi::AamvaDetailedMatchResult

Inherits:
Object
  • Object
show all
Defined in:
lib/the_plaid_api/models/aamva_detailed_match_result.rb

Overview

The outcome of checking the associated hit against state databases. ‘match`

  • The field is an exact match with the state database. ‘partial_match` - The

field is a partial match with the state database. ‘no_match` - The field is not an exact match with the state database. `no_data` - The field was unable to be checked against state databases.

Constant Summary collapse

AAMVA_DETAILED_MATCH_RESULT =
[
  # TODO: Write general description for MATCH
  MATCH = 'match'.freeze,

  # TODO: Write general description for PARTIAL_MATCH
  PARTIAL_MATCH = 'partial_match'.freeze,

  # TODO: Write general description for NO_MATCH
  NO_MATCH = 'no_match'.freeze,

  # TODO: Write general description for NO_DATA
  NO_DATA = 'no_data'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = MATCH) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/the_plaid_api/models/aamva_detailed_match_result.rb', line 33

def self.from_value(value, default_value = MATCH)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'match' then MATCH
  when 'partial_match' then PARTIAL_MATCH
  when 'no_match' then NO_MATCH
  when 'no_data' then NO_DATA
  else
    default_value
  end
end

.validate(value) ⇒ Object



27
28
29
30
31
# File 'lib/the_plaid_api/models/aamva_detailed_match_result.rb', line 27

def self.validate(value)
  return false if value.nil?

  AAMVA_DETAILED_MATCH_RESULT.include?(value)
end