Class: ThePlaidApi::CreditAccountSubtype

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

Overview

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

Constant Summary collapse

CREDIT_ACCOUNT_SUBTYPE =
[
  # TODO: Write general description for ENUM_CREDIT_CARD
  ENUM_CREDIT_CARD = 'credit card'.freeze,

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ENUM_CREDIT_CARD) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/the_plaid_api/models/credit_account_subtype.rb', line 28

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

  str = value.to_s.strip

  case str.downcase
  when 'enum_credit_card' then ENUM_CREDIT_CARD
  when 'paypal' then PAYPAL
  when 'all' then ALL
  else
    default_value
  end
end

.validate(value) ⇒ Object



22
23
24
25
26
# File 'lib/the_plaid_api/models/credit_account_subtype.rb', line 22

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

  CREDIT_ACCOUNT_SUBTYPE.include?(value)
end