Class: ThePlaidApi::DepositoryAccountSubtype

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

Overview

Valid account subtypes for depository accounts. For a list containing descriptions of each subtype, see [Account schemas](plaid.com/docs/api/accounts/#StandaloneAccountType-deposito ry).

Constant Summary collapse

DEPOSITORY_ACCOUNT_SUBTYPE =
[
  # TODO: Write general description for CHECKING
  CHECKING = 'checking'.freeze,

  # TODO: Write general description for SAVINGS
  SAVINGS = 'savings'.freeze,

  # TODO: Write general description for HSA
  HSA = 'hsa'.freeze,

  # TODO: Write general description for CD
  CD = 'cd'.freeze,

  # TODO: Write general description for ENUM_MONEY_MARKET
  ENUM_MONEY_MARKET = 'money market'.freeze,

  # TODO: Write general description for PAYPAL
  PAYPAL = 'paypal'.freeze,

  # TODO: Write general description for PREPAID
  PREPAID = 'prepaid'.freeze,

  # TODO: Write general description for ENUM_CASH_MANAGEMENT
  ENUM_CASH_MANAGEMENT = 'cash management'.freeze,

  # TODO: Write general description for EBT
  EBT = 'ebt'.freeze,

  # TODO: Write general description for ENUM_LIMITED_PURPOSE_CHECKING
  ENUM_LIMITED_PURPOSE_CHECKING = 'limited purpose checking'.freeze,

  # TODO: Write general description for ALL
  ALL = 'all'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = CHECKING) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/the_plaid_api/models/depository_account_subtype.rb', line 53

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

  str = value.to_s.strip

  case str.downcase
  when 'checking' then CHECKING
  when 'savings' then SAVINGS
  when 'hsa' then HSA
  when 'cd' then CD
  when 'enum_money_market' then ENUM_MONEY_MARKET
  when 'paypal' then PAYPAL
  when 'prepaid' then PREPAID
  when 'enum_cash_management' then ENUM_CASH_MANAGEMENT
  when 'ebt' then EBT
  when 'enum_limited_purpose_checking' then ENUM_LIMITED_PURPOSE_CHECKING
  when 'all' then ALL
  else
    default_value
  end
end

.validate(value) ⇒ Object



47
48
49
50
51
# File 'lib/the_plaid_api/models/depository_account_subtype.rb', line 47

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

  DEPOSITORY_ACCOUNT_SUBTYPE.include?(value)
end