Class: ThePlaidApi::HumanReviewStatus

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

Overview

The outcome of the human review check, when available. The following values are possible: ‘success` - The document passed the check. `failed` - The document failed the check. `no_data` - The document was submitted, but the document specialist review was not completed in time.

Constant Summary collapse

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

  # TODO: Write general description for FAILED
  FAILED = 'failed'.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 = SUCCESS) ⇒ Object



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

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 'no_data' then NO_DATA
  else
    default_value
  end
end

.validate(value) ⇒ Object



23
24
25
26
27
# File 'lib/the_plaid_api/models/human_review_status.rb', line 23

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

  HUMAN_REVIEW_STATUS.include?(value)
end