Class: Plaid::DepositoryAccount
- Defined in:
- lib/plaid/models/depository_account.rb
Overview
An account type holding cash, in which funds are deposited. Supported products for ‘depository` accounts are: Auth, Balance, Transactions, Identity, Payment Initiation, and Assets.
Instance Attribute Summary collapse
-
#cash_management ⇒ String
A cash management account, typically a cash account at a brokerage.
-
#cd ⇒ String
Certificate of deposit account.
-
#checking ⇒ String
Checking account.
-
#ebt ⇒ String
An Electronic Benefit Transfer (EBT) account, used by certain public assistance programs to distribute funds (US only).
-
#hsa ⇒ String
Health Savings Account (US only) that can only hold cash.
-
#money_market ⇒ String
Money market account.
-
#paypal ⇒ String
PayPal depository account.
-
#prepaid ⇒ String
Prepaid debit card.
-
#savings ⇒ String
Savings account.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(checking:, savings:, hsa:, cd:, money_market:, paypal:, prepaid:, cash_management:, ebt:, additional_properties: nil) ⇒ DepositoryAccount
constructor
A new instance of DepositoryAccount.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(checking:, savings:, hsa:, cd:, money_market:, paypal:, prepaid:, cash_management:, ebt:, additional_properties: nil) ⇒ DepositoryAccount
Returns a new instance of DepositoryAccount.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/plaid/models/depository_account.rb', line 76 def initialize(checking:, savings:, hsa:, cd:, money_market:, paypal:, prepaid:, cash_management:, ebt:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @checking = checking @savings = savings @hsa = hsa @cd = cd @money_market = money_market @paypal = paypal @prepaid = prepaid @cash_management = cash_management @ebt = ebt @additional_properties = additional_properties end |
Instance Attribute Details
#cash_management ⇒ String
A cash management account, typically a cash account at a brokerage
44 45 46 |
# File 'lib/plaid/models/depository_account.rb', line 44 def cash_management @cash_management end |
#cd ⇒ String
Certificate of deposit account
28 29 30 |
# File 'lib/plaid/models/depository_account.rb', line 28 def cd @cd end |
#checking ⇒ String
Checking account
16 17 18 |
# File 'lib/plaid/models/depository_account.rb', line 16 def checking @checking end |
#ebt ⇒ String
An Electronic Benefit Transfer (EBT) account, used by certain public assistance programs to distribute funds (US only)
49 50 51 |
# File 'lib/plaid/models/depository_account.rb', line 49 def ebt @ebt end |
#hsa ⇒ String
Health Savings Account (US only) that can only hold cash
24 25 26 |
# File 'lib/plaid/models/depository_account.rb', line 24 def hsa @hsa end |
#money_market ⇒ String
Money market account
32 33 34 |
# File 'lib/plaid/models/depository_account.rb', line 32 def money_market @money_market end |
#paypal ⇒ String
PayPal depository account
36 37 38 |
# File 'lib/plaid/models/depository_account.rb', line 36 def paypal @paypal end |
#prepaid ⇒ String
Prepaid debit card
40 41 42 |
# File 'lib/plaid/models/depository_account.rb', line 40 def prepaid @prepaid end |
#savings ⇒ String
Savings account
20 21 22 |
# File 'lib/plaid/models/depository_account.rb', line 20 def savings @savings end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
94 95 96 97 98 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 |
# File 'lib/plaid/models/depository_account.rb', line 94 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. checking = hash.key?('checking') ? hash['checking'] : nil savings = hash.key?('savings') ? hash['savings'] : nil hsa = hash.key?('hsa') ? hash['hsa'] : nil cd = hash.key?('cd') ? hash['cd'] : 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 cash_management = hash.key?('cash management') ? hash['cash management'] : nil ebt = hash.key?('ebt') ? hash['ebt'] : 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(checking: checking, savings: savings, hsa: hsa, cd: cd, money_market: money_market, paypal: paypal, prepaid: prepaid, cash_management: cash_management, ebt: ebt, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/plaid/models/depository_account.rb', line 52 def self.names @_hash = {} if @_hash.nil? @_hash['checking'] = 'checking' @_hash['savings'] = 'savings' @_hash['hsa'] = 'hsa' @_hash['cd'] = 'cd' @_hash['money_market'] = 'money market' @_hash['paypal'] = 'paypal' @_hash['prepaid'] = 'prepaid' @_hash['cash_management'] = 'cash management' @_hash['ebt'] = 'ebt' @_hash end |
.nullables ⇒ Object
An array for nullable fields
72 73 74 |
# File 'lib/plaid/models/depository_account.rb', line 72 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
67 68 69 |
# File 'lib/plaid/models/depository_account.rb', line 67 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
138 139 140 141 142 143 144 145 |
# File 'lib/plaid/models/depository_account.rb', line 138 def inspect class_name = self.class.name.split('::').last "<#{class_name} checking: #{@checking.inspect}, savings: #{@savings.inspect}, hsa:"\ " #{@hsa.inspect}, cd: #{@cd.inspect}, money_market: #{@money_market.inspect}, paypal:"\ " #{@paypal.inspect}, prepaid: #{@prepaid.inspect}, cash_management:"\ " #{@cash_management.inspect}, ebt: #{@ebt.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
130 131 132 133 134 135 |
# File 'lib/plaid/models/depository_account.rb', line 130 def to_s class_name = self.class.name.split('::').last "<#{class_name} checking: #{@checking}, savings: #{@savings}, hsa: #{@hsa}, cd: #{@cd},"\ " money_market: #{@money_market}, paypal: #{@paypal}, prepaid: #{@prepaid}, cash_management:"\ " #{@cash_management}, ebt: #{@ebt}, additional_properties: #{@additional_properties}>" end |