Class: ThePlaidApi::EntityDocumentType

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

Overview

The kind of official document represented by this object. ‘bik` - Russian bank code `business_number` - A number that uniquely identifies the business within a category of businesses `imo` - Number assigned to the entity by the International Maritime Organization `other` - Any document not covered by other categories `swift` - Number identifying a bank and branch. `tax_id` - Identification issued for the purpose of collecting taxes

Constant Summary collapse

ENTITY_DOCUMENT_TYPE =
[
  # TODO: Write general description for BIK
  BIK = 'bik'.freeze,

  # TODO: Write general description for BUSINESS_NUMBER
  BUSINESS_NUMBER = 'business_number'.freeze,

  # TODO: Write general description for IMO
  IMO = 'imo'.freeze,

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

  # TODO: Write general description for SWIFT
  SWIFT = 'swift'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = BIK) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/the_plaid_api/models/entity_document_type.rb', line 40

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

  str = value.to_s.strip

  case str.downcase
  when 'bik' then BIK
  when 'business_number' then BUSINESS_NUMBER
  when 'imo' then IMO
  when 'other' then OTHER
  when 'swift' then SWIFT
  when 'tax_id' then TAX_ID
  else
    default_value
  end
end

.validate(value) ⇒ Object



34
35
36
37
38
# File 'lib/the_plaid_api/models/entity_document_type.rb', line 34

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

  ENTITY_DOCUMENT_TYPE.include?(value)
end