Class: ThePlaidApi::BeaconMatchSummaryCode

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

Overview

An enum indicating the match type between two Beacon Users. ‘match` indicates that the provided input data was a strong match against the other Beacon User. `partial_match` indicates the data approximately matched the other Beacon User. For example, “Knope” vs. “Knope-Wyatt” for last name. `no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. `no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.

Constant Summary collapse

BEACON_MATCH_SUMMARY_CODE =
[
  # 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



36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/the_plaid_api/models/beacon_match_summary_code.rb', line 36

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



30
31
32
33
34
# File 'lib/the_plaid_api/models/beacon_match_summary_code.rb', line 30

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

  BEACON_MATCH_SUMMARY_CODE.include?(value)
end