Class: ThePlaidApi::HolderCategory

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

Overview

Indicates the account’s categorization as either a personal or a business account. This field is currently in beta; to request access, contact your account manager.

Constant Summary collapse

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

  # TODO: Write general description for PERSONAL
  PERSONAL = 'personal'.freeze,

  # TODO: Write general description for UNRECOGNIZED
  UNRECOGNIZED = 'unrecognized'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = BUSINESS) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'business' then BUSINESS
  when 'personal' then PERSONAL
  when 'unrecognized' then UNRECOGNIZED
  else
    default_value
  end
end

.validate(value) ⇒ Object



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

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

  HOLDER_CATEGORY.include?(value)
end