Class: ThePlaidApi::WatchlistScreeningDocumentType

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

Overview

The kind of official document represented by this object. ‘birth_certificate` - A certificate of birth `drivers_license` - A license to operate a motor vehicle `immigration_number` - Immigration or residence documents `military_id` - Identification issued by a military group `other`

  • Any document not covered by other categories ‘passport` - An official

passport issue by a government ‘personal_identification` - Any generic personal identification that is not covered by other categories `ration_card` - Identification that entitles the holder to rations `ssn` - United States Social Security Number `student_id` - Identification issued by an educational institution `tax_id` - Identification issued for the purpose of collecting taxes `travel_document` - Visas, entry permits, refugee documents, etc. `voter_id` - Identification issued for the purpose of voting

Constant Summary collapse

WATCHLIST_SCREENING_DOCUMENT_TYPE =
[
  # TODO: Write general description for BIRTH_CERTIFICATE
  BIRTH_CERTIFICATE = 'birth_certificate'.freeze,

  # TODO: Write general description for DRIVERS_LICENSE
  DRIVERS_LICENSE = 'drivers_license'.freeze,

  # TODO: Write general description for IMMIGRATION_NUMBER
  IMMIGRATION_NUMBER = 'immigration_number'.freeze,

  # TODO: Write general description for MILITARY_ID
  MILITARY_ID = 'military_id'.freeze,

  # TODO: Write general description for OTHER
  OTHER = 'other'.freeze,

  # TODO: Write general description for PASSPORT
  PASSPORT = 'passport'.freeze,

  # TODO: Write general description for PERSONAL_IDENTIFICATION
  PERSONAL_IDENTIFICATION = 'personal_identification'.freeze,

  # TODO: Write general description for RATION_CARD
  RATION_CARD = 'ration_card'.freeze,

  # TODO: Write general description for SSN
  SSN = 'ssn'.freeze,

  # TODO: Write general description for STUDENT_ID
  STUDENT_ID = 'student_id'.freeze,

  # TODO: Write general description for TAX_ID
  TAX_ID = 'tax_id'.freeze,

  # TODO: Write general description for TRAVEL_DOCUMENT
  TRAVEL_DOCUMENT = 'travel_document'.freeze,

  # TODO: Write general description for VOTER_ID
  VOTER_ID = 'voter_id'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = BIRTH_CERTIFICATE) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/the_plaid_api/models/watchlist_screening_document_type.rb', line 67

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

  str = value.to_s.strip

  case str.downcase
  when 'birth_certificate' then BIRTH_CERTIFICATE
  when 'drivers_license' then DRIVERS_LICENSE
  when 'immigration_number' then IMMIGRATION_NUMBER
  when 'military_id' then MILITARY_ID
  when 'other' then OTHER
  when 'passport' then PASSPORT
  when 'personal_identification' then PERSONAL_IDENTIFICATION
  when 'ration_card' then RATION_CARD
  when 'ssn' then SSN
  when 'student_id' then STUDENT_ID
  when 'tax_id' then TAX_ID
  when 'travel_document' then TRAVEL_DOCUMENT
  when 'voter_id' then VOTER_ID
  else
    default_value
  end
end

.validate(value) ⇒ Object



61
62
63
64
65
# File 'lib/the_plaid_api/models/watchlist_screening_document_type.rb', line 61

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

  WATCHLIST_SCREENING_DOCUMENT_TYPE.include?(value)
end