Class: ThePlaidApi::MatchSummaryCode1

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

Overview

An enum indicating the match type between data provided by user and data checked against an external data source. ‘match` indicates that the provided input data was a strong match against external data. `partial_match` indicates the data approximately matched against external data. For example, “Knope” vs. “Knope-Wyatt” for last name. `no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. `no_data` indicates that Plaid was unable to find external data to compare against the provided input data. `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.

Constant Summary collapse

MATCH_SUMMARY_CODE1 =
[
  # 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,

  # TODO: Write general description for NO_INPUT
  NO_INPUT = 'no_input'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = MATCH) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/the_plaid_api/models/match_summary_code1.rb', line 41

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
  when 'no_input' then NO_INPUT
  else
    default_value
  end
end

.validate(value) ⇒ Object



35
36
37
38
39
# File 'lib/the_plaid_api/models/match_summary_code1.rb', line 35

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

  MATCH_SUMMARY_CODE1.include?(value)
end