Class: ThePlaidApi::DocumentStatus

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

Overview

An outcome status for this specific document submission. Distinct from the overall ‘documentary_verification.status` that summarizes the verification outcome from one or more documents.

Constant Summary collapse

DOCUMENT_STATUS =
[
  # TODO: Write general description for SUCCESS
  SUCCESS = 'success'.freeze,

  # TODO: Write general description for FAILED
  FAILED = 'failed'.freeze,

  # TODO: Write general description for MANUALLY_APPROVED
  MANUALLY_APPROVED = 'manually_approved'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = SUCCESS) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'success' then SUCCESS
  when 'failed' then FAILED
  when 'manually_approved' then MANUALLY_APPROVED
  else
    default_value
  end
end

.validate(value) ⇒ Object



22
23
24
25
26
# File 'lib/the_plaid_api/models/document_status.rb', line 22

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

  DOCUMENT_STATUS.include?(value)
end