Class: ThePlaidApi::VerificationInsightsAccountNumberFormat

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

Overview

Indicator of account number format validity for institution. ‘valid`: indicates that the account number has a correct format for the institution. `invalid`: indicates that the account number has an incorrect format for the institution. `unknown`: indicates that there was not enough information to determine whether the format is correct for the institution.

Constant Summary collapse

VERIFICATION_INSIGHTS_ACCOUNT_NUMBER_FORMAT =
[
  # TODO: Write general description for VALID
  VALID = 'valid'.freeze,

  # TODO: Write general description for INVALID
  INVALID = 'invalid'.freeze,

  # TODO: Write general description for UNKNOWN
  UNKNOWN = 'unknown'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = VALID) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'valid' then VALID
  when 'invalid' then INVALID
  when 'unknown' then UNKNOWN
  else
    default_value
  end
end

.validate(value) ⇒ Object



24
25
26
27
28
# File 'lib/the_plaid_api/models/verification_insights_account_number_format.rb', line 24

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

  VERIFICATION_INSIGHTS_ACCOUNT_NUMBER_FORMAT.include?(value)
end