Class: Plaid::LoanAccount
- Defined in:
- lib/plaid/models/loan_account.rb
Overview
A loan type account. Supported products for ‘loan` accounts are: Balance, Liabilities, and Transactions.
Instance Attribute Summary collapse
-
#auto ⇒ String
Auto loan.
-
#business ⇒ String
Business loan.
-
#commercial ⇒ String
Commercial loan.
-
#construction ⇒ String
Construction loan.
-
#consumer ⇒ String
Consumer loan.
-
#home_equity ⇒ String
Home Equity Line of Credit (HELOC).
-
#line_of_credit ⇒ String
Pre-approved line of credit.
-
#loan ⇒ String
General loan.
-
#mortgage ⇒ String
Mortgage loan.
-
#other ⇒ String
Other loan type or unknown loan type.
-
#overdraft ⇒ String
Pre-approved overdraft account, usually tied to a checking account.
-
#student ⇒ String
Student loan.
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(auto:, business:, commercial:, construction:, consumer:, home_equity:, loan:, mortgage:, overdraft:, line_of_credit:, student:, other:, additional_properties: nil) ⇒ LoanAccount
constructor
A new instance of LoanAccount.
-
#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(auto:, business:, commercial:, construction:, consumer:, home_equity:, loan:, mortgage:, overdraft:, line_of_credit:, student:, other:, additional_properties: nil) ⇒ LoanAccount
Returns a new instance of LoanAccount.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/plaid/models/loan_account.rb', line 89 def initialize(auto:, business:, commercial:, construction:, consumer:, home_equity:, loan:, mortgage:, overdraft:, line_of_credit:, student:, other:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @auto = auto @business = business @commercial = commercial @construction = construction @consumer = consumer @home_equity = home_equity @loan = loan @mortgage = mortgage @overdraft = overdraft @line_of_credit = line_of_credit @student = student @other = other @additional_properties = additional_properties end |
Instance Attribute Details
#auto ⇒ String
Auto loan
15 16 17 |
# File 'lib/plaid/models/loan_account.rb', line 15 def auto @auto end |
#business ⇒ String
Business loan
19 20 21 |
# File 'lib/plaid/models/loan_account.rb', line 19 def business @business end |
#commercial ⇒ String
Commercial loan
23 24 25 |
# File 'lib/plaid/models/loan_account.rb', line 23 def commercial @commercial end |
#construction ⇒ String
Construction loan
27 28 29 |
# File 'lib/plaid/models/loan_account.rb', line 27 def construction @construction end |
#consumer ⇒ String
Consumer loan
31 32 33 |
# File 'lib/plaid/models/loan_account.rb', line 31 def consumer @consumer end |
#home_equity ⇒ String
Home Equity Line of Credit (HELOC)
35 36 37 |
# File 'lib/plaid/models/loan_account.rb', line 35 def home_equity @home_equity end |
#line_of_credit ⇒ String
Pre-approved line of credit
51 52 53 |
# File 'lib/plaid/models/loan_account.rb', line 51 def line_of_credit @line_of_credit end |
#loan ⇒ String
General loan
39 40 41 |
# File 'lib/plaid/models/loan_account.rb', line 39 def loan @loan end |
#mortgage ⇒ String
Mortgage loan
43 44 45 |
# File 'lib/plaid/models/loan_account.rb', line 43 def mortgage @mortgage end |
#other ⇒ String
Other loan type or unknown loan type
59 60 61 |
# File 'lib/plaid/models/loan_account.rb', line 59 def other @other end |
#overdraft ⇒ String
Pre-approved overdraft account, usually tied to a checking account
47 48 49 |
# File 'lib/plaid/models/loan_account.rb', line 47 def overdraft @overdraft end |
#student ⇒ String
Student loan
55 56 57 |
# File 'lib/plaid/models/loan_account.rb', line 55 def student @student end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/plaid/models/loan_account.rb', line 111 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. auto = hash.key?('auto') ? hash['auto'] : nil business = hash.key?('business') ? hash['business'] : nil commercial = hash.key?('commercial') ? hash['commercial'] : nil construction = hash.key?('construction') ? hash['construction'] : nil consumer = hash.key?('consumer') ? hash['consumer'] : nil home_equity = hash.key?('home equity') ? hash['home equity'] : nil loan = hash.key?('loan') ? hash['loan'] : nil mortgage = hash.key?('mortgage') ? hash['mortgage'] : nil overdraft = hash.key?('overdraft') ? hash['overdraft'] : nil line_of_credit = hash.key?('line of credit') ? hash['line of credit'] : nil student = hash.key?('student') ? hash['student'] : nil other = hash.key?('other') ? hash['other'] : 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. LoanAccount.new(auto: auto, business: business, commercial: commercial, construction: construction, consumer: consumer, home_equity: home_equity, loan: loan, mortgage: mortgage, overdraft: overdraft, line_of_credit: line_of_credit, student: student, other: other, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/plaid/models/loan_account.rb', line 62 def self.names @_hash = {} if @_hash.nil? @_hash['auto'] = 'auto' @_hash['business'] = 'business' @_hash['commercial'] = 'commercial' @_hash['construction'] = 'construction' @_hash['consumer'] = 'consumer' @_hash['home_equity'] = 'home equity' @_hash['loan'] = 'loan' @_hash['mortgage'] = 'mortgage' @_hash['overdraft'] = 'overdraft' @_hash['line_of_credit'] = 'line of credit' @_hash['student'] = 'student' @_hash['other'] = 'other' @_hash end |
.nullables ⇒ Object
An array for nullable fields
85 86 87 |
# File 'lib/plaid/models/loan_account.rb', line 85 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
80 81 82 |
# File 'lib/plaid/models/loan_account.rb', line 80 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
163 164 165 166 167 168 169 170 171 |
# File 'lib/plaid/models/loan_account.rb', line 163 def inspect class_name = self.class.name.split('::').last "<#{class_name} auto: #{@auto.inspect}, business: #{@business.inspect}, commercial:"\ " #{@commercial.inspect}, construction: #{@construction.inspect}, consumer:"\ " #{@consumer.inspect}, home_equity: #{@home_equity.inspect}, loan: #{@loan.inspect},"\ " mortgage: #{@mortgage.inspect}, overdraft: #{@overdraft.inspect}, line_of_credit:"\ " #{@line_of_credit.inspect}, student: #{@student.inspect}, other: #{@other.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
153 154 155 156 157 158 159 160 |
# File 'lib/plaid/models/loan_account.rb', line 153 def to_s class_name = self.class.name.split('::').last "<#{class_name} auto: #{@auto}, business: #{@business}, commercial: #{@commercial},"\ " construction: #{@construction}, consumer: #{@consumer}, home_equity: #{@home_equity},"\ " loan: #{@loan}, mortgage: #{@mortgage}, overdraft: #{@overdraft}, line_of_credit:"\ " #{@line_of_credit}, student: #{@student}, other: #{@other}, additional_properties:"\ " #{@additional_properties}>" end |