Class: ThePlaidApi::OtherAccountSubtype

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

Overview

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

Constant Summary collapse

OTHER_ACCOUNT_SUBTYPE =
[
  # 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 = OTHER) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/the_plaid_api/models/other_account_subtype.rb', line 25

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

  str = value.to_s.strip

  case str.downcase
  when 'other' then OTHER
  when 'all' then ALL
  else
    default_value
  end
end

.validate(value) ⇒ Object



19
20
21
22
23
# File 'lib/the_plaid_api/models/other_account_subtype.rb', line 19

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

  OTHER_ACCOUNT_SUBTYPE.include?(value)
end