Class: ThePlaidApi::DepositoryAccount

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

Overview

An account type holding cash, in which funds are deposited.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(cash_management:, cd:, checking:, ebt:, hsa:, limited_purpose_checking:, money_market:, paypal:, prepaid:, savings:, additional_properties: nil) ⇒ DepositoryAccount

Returns a new instance of DepositoryAccount.



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/the_plaid_api/models/depository_account.rb', line 79

def initialize(cash_management:, cd:, checking:, ebt:, hsa:,
               limited_purpose_checking:, money_market:, paypal:, prepaid:,
               savings:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @cash_management = cash_management
  @cd = cd
  @checking = checking
  @ebt = ebt
  @hsa = hsa
  @limited_purpose_checking = limited_purpose_checking
  @money_market = money_market
  @paypal = paypal
  @prepaid = prepaid
  @savings = savings
  @additional_properties = additional_properties
end

Instance Attribute Details

#cash_managementString

A cash management account, typically a cash account at a brokerage

Returns:

  • (String)


14
15
16
# File 'lib/the_plaid_api/models/depository_account.rb', line 14

def cash_management
  @cash_management
end

#cdString

Certificate of deposit account

Returns:

  • (String)


18
19
20
# File 'lib/the_plaid_api/models/depository_account.rb', line 18

def cd
  @cd
end

#checkingString

Checking account

Returns:

  • (String)


22
23
24
# File 'lib/the_plaid_api/models/depository_account.rb', line 22

def checking
  @checking
end

#ebtString

An Electronic Benefit Transfer (EBT) account, used by certain public assistance programs to distribute funds (US only)

Returns:

  • (String)


27
28
29
# File 'lib/the_plaid_api/models/depository_account.rb', line 27

def ebt
  @ebt
end

#hsaString

Health Savings Account (US only) that can only hold cash

Returns:

  • (String)


31
32
33
# File 'lib/the_plaid_api/models/depository_account.rb', line 31

def hsa
  @hsa
end

#limited_purpose_checkingString

A checking account that is limited in its purpose or usage

Returns:

  • (String)


35
36
37
# File 'lib/the_plaid_api/models/depository_account.rb', line 35

def limited_purpose_checking
  @limited_purpose_checking
end

#money_marketString

Money market account

Returns:

  • (String)


39
40
41
# File 'lib/the_plaid_api/models/depository_account.rb', line 39

def money_market
  @money_market
end

#paypalString

PayPal depository account

Returns:

  • (String)


43
44
45
# File 'lib/the_plaid_api/models/depository_account.rb', line 43

def paypal
  @paypal
end

#prepaidString

Prepaid debit card

Returns:

  • (String)


47
48
49
# File 'lib/the_plaid_api/models/depository_account.rb', line 47

def prepaid
  @prepaid
end

#savingsString

Savings account

Returns:

  • (String)


51
52
53
# File 'lib/the_plaid_api/models/depository_account.rb', line 51

def savings
  @savings
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/the_plaid_api/models/depository_account.rb', line 99

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  cash_management =
    hash.key?('cash management') ? hash['cash management'] : nil
  cd = hash.key?('cd') ? hash['cd'] : nil
  checking = hash.key?('checking') ? hash['checking'] : nil
  ebt = hash.key?('ebt') ? hash['ebt'] : nil
  hsa = hash.key?('hsa') ? hash['hsa'] : nil
  limited_purpose_checking =
    hash.key?('limited purpose checking') ? hash['limited purpose checking'] : nil
  money_market = hash.key?('money market') ? hash['money market'] : nil
  paypal = hash.key?('paypal') ? hash['paypal'] : nil
  prepaid = hash.key?('prepaid') ? hash['prepaid'] : nil
  savings = hash.key?('savings') ? hash['savings'] : nil

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  DepositoryAccount.new(cash_management: cash_management,
                        cd: cd,
                        checking: checking,
                        ebt: ebt,
                        hsa: hsa,
                        limited_purpose_checking: limited_purpose_checking,
                        money_market: money_market,
                        paypal: paypal,
                        prepaid: prepaid,
                        savings: savings,
                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/the_plaid_api/models/depository_account.rb', line 54

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['cash_management'] = 'cash management'
  @_hash['cd'] = 'cd'
  @_hash['checking'] = 'checking'
  @_hash['ebt'] = 'ebt'
  @_hash['hsa'] = 'hsa'
  @_hash['limited_purpose_checking'] = 'limited purpose checking'
  @_hash['money_market'] = 'money market'
  @_hash['paypal'] = 'paypal'
  @_hash['prepaid'] = 'prepaid'
  @_hash['savings'] = 'savings'
  @_hash
end

.nullablesObject

An array for nullable fields



75
76
77
# File 'lib/the_plaid_api/models/depository_account.rb', line 75

def self.nullables
  []
end

.optionalsObject

An array for optional fields



70
71
72
# File 'lib/the_plaid_api/models/depository_account.rb', line 70

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



147
148
149
150
151
152
153
154
# File 'lib/the_plaid_api/models/depository_account.rb', line 147

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} cash_management: #{@cash_management.inspect}, cd: #{@cd.inspect}, checking:"\
  " #{@checking.inspect}, ebt: #{@ebt.inspect}, hsa: #{@hsa.inspect},"\
  " limited_purpose_checking: #{@limited_purpose_checking.inspect}, money_market:"\
  " #{@money_market.inspect}, paypal: #{@paypal.inspect}, prepaid: #{@prepaid.inspect},"\
  " savings: #{@savings.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



138
139
140
141
142
143
144
# File 'lib/the_plaid_api/models/depository_account.rb', line 138

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} cash_management: #{@cash_management}, cd: #{@cd}, checking: #{@checking},"\
  " ebt: #{@ebt}, hsa: #{@hsa}, limited_purpose_checking: #{@limited_purpose_checking},"\
  " money_market: #{@money_market}, paypal: #{@paypal}, prepaid: #{@prepaid}, savings:"\
  " #{@savings}, additional_properties: #{@additional_properties}>"
end