Class: ThePlaidApi::IncomeVerificationDocParsingConfig

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

Overview

Analysis options to enable for document parsing

Constant Summary collapse

INCOME_VERIFICATION_DOC_PARSING_CONFIG =
[
  # TODO: Write general description for OCR
  OCR = 'ocr'.freeze,

  # TODO: Write general description for RISK_SIGNALS
  RISK_SIGNALS = 'risk_signals'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = OCR) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/the_plaid_api/models/income_verification_doc_parsing_config.rb', line 23

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

  str = value.to_s.strip

  case str.downcase
  when 'ocr' then OCR
  when 'risk_signals' then RISK_SIGNALS
  else
    default_value
  end
end

.validate(value) ⇒ Object



17
18
19
20
21
# File 'lib/the_plaid_api/models/income_verification_doc_parsing_config.rb', line 17

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

  INCOME_VERIFICATION_DOC_PARSING_CONFIG.include?(value)
end