Class: ThePlaidApi::SelfieAnalysisDocumentComparison

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

Overview

Information about the comparison between the selfie and the document (if documentary verification also ran).

Constant Summary collapse

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

  # TODO: Write general description for NO_MATCH
  NO_MATCH = 'no_match'.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



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/the_plaid_api/models/selfie_analysis_document_comparison.rb', line 27

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

.validate(value) ⇒ Object



21
22
23
24
25
# File 'lib/the_plaid_api/models/selfie_analysis_document_comparison.rb', line 21

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

  SELFIE_ANALYSIS_DOCUMENT_COMPARISON.include?(value)
end