Class: ThePlaidApi::LoanAccount
- Defined in:
- lib/the_plaid_api/models/loan_account.rb
Overview
A loan type account.
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:, line_of_credit:, loan:, mortgage:, other:, overdraft:, student:, 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:, line_of_credit:, loan:, mortgage:, other:, overdraft:, student:, additional_properties: nil) ⇒ LoanAccount
Returns a new instance of LoanAccount.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 88 def initialize(auto:, business:, commercial:, construction:, consumer:, home_equity:, line_of_credit:, loan:, mortgage:, other:, overdraft:, student:, 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 @line_of_credit = line_of_credit @loan = loan @mortgage = mortgage @other = other @overdraft = overdraft @student = student @additional_properties = additional_properties end |
Instance Attribute Details
#auto ⇒ String
Auto loan
14 15 16 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 14 def auto @auto end |
#business ⇒ String
Business loan
18 19 20 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 18 def business @business end |
#commercial ⇒ String
Commercial loan
22 23 24 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 22 def commercial @commercial end |
#construction ⇒ String
Construction loan
26 27 28 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 26 def construction @construction end |
#consumer ⇒ String
Consumer loan
30 31 32 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 30 def consumer @consumer end |
#home_equity ⇒ String
Home Equity Line of Credit (HELOC)
34 35 36 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 34 def home_equity @home_equity end |
#line_of_credit ⇒ String
Pre-approved line of credit
38 39 40 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 38 def line_of_credit @line_of_credit end |
#loan ⇒ String
General loan
42 43 44 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 42 def loan @loan end |
#mortgage ⇒ String
Mortgage loan
46 47 48 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 46 def mortgage @mortgage end |
#other ⇒ String
Other loan type or unknown loan type
50 51 52 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 50 def other @other end |
#overdraft ⇒ String
Pre-approved overdraft account, usually tied to a checking account
54 55 56 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 54 def overdraft @overdraft end |
#student ⇒ String
Student loan
58 59 60 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 58 def student @student end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 110 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 line_of_credit = hash.key?('line of credit') ? hash['line of credit'] : nil loan = hash.key?('loan') ? hash['loan'] : nil mortgage = hash.key?('mortgage') ? hash['mortgage'] : nil other = hash.key?('other') ? hash['other'] : nil overdraft = hash.key?('overdraft') ? hash['overdraft'] : nil student = hash.key?('student') ? hash['student'] : 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, line_of_credit: line_of_credit, loan: loan, mortgage: mortgage, other: other, overdraft: overdraft, student: student, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 61 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['line_of_credit'] = 'line of credit' @_hash['loan'] = 'loan' @_hash['mortgage'] = 'mortgage' @_hash['other'] = 'other' @_hash['overdraft'] = 'overdraft' @_hash['student'] = 'student' @_hash end |
.nullables ⇒ Object
An array for nullable fields
84 85 86 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 84 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
79 80 81 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 79 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
162 163 164 165 166 167 168 169 170 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 162 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}, line_of_credit:"\ " #{@line_of_credit.inspect}, loan: #{@loan.inspect}, mortgage: #{@mortgage.inspect}, other:"\ " #{@other.inspect}, overdraft: #{@overdraft.inspect}, student: #{@student.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
152 153 154 155 156 157 158 159 |
# File 'lib/the_plaid_api/models/loan_account.rb', line 152 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},"\ " line_of_credit: #{@line_of_credit}, loan: #{@loan}, mortgage: #{@mortgage}, other:"\ " #{@other}, overdraft: #{@overdraft}, student: #{@student}, additional_properties:"\ " #{@additional_properties}>" end |