Class: ThePlaidApi::LoanAccountSubtype

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

Overview

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

Constant Summary collapse

LOAN_ACCOUNT_SUBTYPE =
[
  # TODO: Write general description for AUTO
  AUTO = 'auto'.freeze,

  # TODO: Write general description for BUSINESS
  BUSINESS = 'business'.freeze,

  # TODO: Write general description for COMMERCIAL
  COMMERCIAL = 'commercial'.freeze,

  # TODO: Write general description for CONSTRUCTION
  CONSTRUCTION = 'construction'.freeze,

  # TODO: Write general description for CONSUMER
  CONSUMER = 'consumer'.freeze,

  # TODO: Write general description for ENUM_HOME_EQUITY
  ENUM_HOME_EQUITY = 'home equity'.freeze,

  # TODO: Write general description for LOAN
  LOAN = 'loan'.freeze,

  # TODO: Write general description for MORTGAGE
  MORTGAGE = 'mortgage'.freeze,

  # TODO: Write general description for OVERDRAFT
  OVERDRAFT = 'overdraft'.freeze,

  # TODO: Write general description for ENUM_LINE_OF_CREDIT
  ENUM_LINE_OF_CREDIT = 'line of credit'.freeze,

  # TODO: Write general description for STUDENT
  STUDENT = 'student'.freeze,

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = AUTO) ⇒ Object



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/the_plaid_api/models/loan_account_subtype.rb', line 58

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

  str = value.to_s.strip

  case str.downcase
  when 'auto' then AUTO
  when 'business' then BUSINESS
  when 'commercial' then COMMERCIAL
  when 'construction' then CONSTRUCTION
  when 'consumer' then CONSUMER
  when 'enum_home_equity' then ENUM_HOME_EQUITY
  when 'loan' then LOAN
  when 'mortgage' then MORTGAGE
  when 'overdraft' then OVERDRAFT
  when 'enum_line_of_credit' then ENUM_LINE_OF_CREDIT
  when 'student' then STUDENT
  when 'other' then OTHER
  when 'all' then ALL
  else
    default_value
  end
end

.validate(value) ⇒ Object



52
53
54
55
56
# File 'lib/the_plaid_api/models/loan_account_subtype.rb', line 52

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

  LOAN_ACCOUNT_SUBTYPE.include?(value)
end