Class: ThePlaidApi::LoanDisbursementsIndicators
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::LoanDisbursementsIndicators
- Defined in:
- lib/the_plaid_api/models/loan_disbursements_indicators.rb
Overview
Insights into loan disbursement transactions received by the user, tracking incoming funds from loan providers.
Instance Attribute Summary collapse
-
#amount ⇒ Float
The total value of inflow transactions categorized as ‘LOAN_DISBURSEMENTS`, across all the accounts in the report within the requested time window.
-
#category_details ⇒ Array[CategoryExpenses]
Detailed categories view of all the transactions that fall into the ‘LOAN_DISBURSEMENTS` credit category within the given time window, across all the accounts in the report.
-
#days_since_last_occurrence ⇒ Integer
The number of days since the last transaction that falls into the ‘LOAN_DISBURSEMENTS` credit category, across all the accounts in the report.
-
#iso_currency_code ⇒ String
The ISO-4217 currency code of the amount.
-
#monthly_average ⇒ MonthlyAverage
The monthly average amount calculated by dividing the total by the number of calendar months in the time period.
-
#monthly_summaries ⇒ Array[MonthlySummary]
The monthly summaries of the transactions that fall into the ‘LOAN_DISBURSEMENTS` category within the given time window, across all the accounts in the report.
-
#percentage_of_income ⇒ Float
The percentage of the user’s monthly inflows that was received on transactions that fall into the ‘LOAN_DISBURSEMENTS` credit category within the given time window, across all the accounts in the report.
-
#top_providers ⇒ Array[String]
Up to 3 top service providers that the user had the most transactions for in the given time window, in descending order of total spend.
-
#transactions_count ⇒ Integer
The total number of transactions that fall into the ‘LOAN_DISBURSEMENTS` credit category, across all the accounts in the report.
-
#unofficial_currency_code ⇒ String
The unofficial currency code associated with the amount.
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(amount: SKIP, iso_currency_code: SKIP, unofficial_currency_code: SKIP, category_details: SKIP, monthly_average: SKIP, top_providers: SKIP, transactions_count: SKIP, monthly_summaries: SKIP, days_since_last_occurrence: SKIP, percentage_of_income: SKIP, additional_properties: nil) ⇒ LoanDisbursementsIndicators
constructor
A new instance of LoanDisbursementsIndicators.
-
#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(amount: SKIP, iso_currency_code: SKIP, unofficial_currency_code: SKIP, category_details: SKIP, monthly_average: SKIP, top_providers: SKIP, transactions_count: SKIP, monthly_summaries: SKIP, days_since_last_occurrence: SKIP, percentage_of_income: SKIP, additional_properties: nil) ⇒ LoanDisbursementsIndicators
Returns a new instance of LoanDisbursementsIndicators.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 122 def initialize(amount: SKIP, iso_currency_code: SKIP, unofficial_currency_code: SKIP, category_details: SKIP, monthly_average: SKIP, top_providers: SKIP, transactions_count: SKIP, monthly_summaries: SKIP, days_since_last_occurrence: SKIP, percentage_of_income: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @amount = amount unless amount == SKIP @iso_currency_code = iso_currency_code unless iso_currency_code == SKIP @unofficial_currency_code = unofficial_currency_code unless unofficial_currency_code == SKIP @category_details = category_details unless category_details == SKIP @monthly_average = monthly_average unless monthly_average == SKIP @top_providers = top_providers unless top_providers == SKIP @transactions_count = transactions_count unless transactions_count == SKIP @monthly_summaries = monthly_summaries unless monthly_summaries == SKIP unless days_since_last_occurrence == SKIP @days_since_last_occurrence = days_since_last_occurrence end @percentage_of_income = percentage_of_income unless percentage_of_income == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#amount ⇒ Float
The total value of inflow transactions categorized as ‘LOAN_DISBURSEMENTS`, across all the accounts in the report within the requested time window.
17 18 19 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 17 def amount @amount end |
#category_details ⇒ Array[CategoryExpenses]
Detailed categories view of all the transactions that fall into the ‘LOAN_DISBURSEMENTS` credit category within the given time window, across all the accounts in the report.
36 37 38 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 36 def category_details @category_details end |
#days_since_last_occurrence ⇒ Integer
The number of days since the last transaction that falls into the ‘LOAN_DISBURSEMENTS` credit category, across all the accounts in the report.
65 66 67 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 65 def days_since_last_occurrence @days_since_last_occurrence end |
#iso_currency_code ⇒ String
The ISO-4217 currency code of the amount. Always ‘null` if `unofficial_currency_code` is non-`null`.
22 23 24 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 22 def iso_currency_code @iso_currency_code end |
#monthly_average ⇒ MonthlyAverage
The monthly average amount calculated by dividing the total by the number of calendar months in the time period.
41 42 43 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 41 def monthly_average @monthly_average end |
#monthly_summaries ⇒ Array[MonthlySummary]
The monthly summaries of the transactions that fall into the ‘LOAN_DISBURSEMENTS` category within the given time window, across all the accounts in the report.
59 60 61 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 59 def monthly_summaries @monthly_summaries end |
#percentage_of_income ⇒ Float
The percentage of the user’s monthly inflows that was received on transactions that fall into the ‘LOAN_DISBURSEMENTS` credit category within the given time window, across all the accounts in the report. For example, a value of 100 indicates that 100% of the inflows were spent on transactions that fall into the `LOAN_DISBURSEMENTS` credit category. If there’s no available income for the given time period, this field value will be ‘-1`.
75 76 77 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 75 def percentage_of_income @percentage_of_income end |
#top_providers ⇒ Array[String]
Up to 3 top service providers that the user had the most transactions for in the given time window, in descending order of total spend. If the user has received money from any provider in the given time window, this list will be empty.
48 49 50 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 48 def top_providers @top_providers end |
#transactions_count ⇒ Integer
The total number of transactions that fall into the ‘LOAN_DISBURSEMENTS` credit category, across all the accounts in the report.
53 54 55 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 53 def transactions_count @transactions_count end |
#unofficial_currency_code ⇒ String
The unofficial currency code associated with the amount. Always ‘null` if `iso_currency_code` is non-`null`. See the [currency code schema](plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `unofficial_currency_code`s.
30 31 32 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 30 def unofficial_currency_code @unofficial_currency_code end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 148 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. amount = hash.key?('amount') ? hash['amount'] : SKIP iso_currency_code = hash.key?('iso_currency_code') ? hash['iso_currency_code'] : SKIP unofficial_currency_code = hash.key?('unofficial_currency_code') ? hash['unofficial_currency_code'] : SKIP # Parameter is an array, so we need to iterate through it category_details = nil unless hash['category_details'].nil? category_details = [] hash['category_details'].each do |structure| category_details << (CategoryExpenses.from_hash(structure) if structure) end end category_details = SKIP unless hash.key?('category_details') monthly_average = MonthlyAverage.from_hash(hash['monthly_average']) if hash['monthly_average'] top_providers = hash.key?('top_providers') ? hash['top_providers'] : SKIP transactions_count = hash.key?('transactions_count') ? hash['transactions_count'] : SKIP # Parameter is an array, so we need to iterate through it monthly_summaries = nil unless hash['monthly_summaries'].nil? monthly_summaries = [] hash['monthly_summaries'].each do |structure| monthly_summaries << (MonthlySummary.from_hash(structure) if structure) end end monthly_summaries = SKIP unless hash.key?('monthly_summaries') days_since_last_occurrence = hash.key?('days_since_last_occurrence') ? hash['days_since_last_occurrence'] : SKIP percentage_of_income = hash.key?('percentage_of_income') ? hash['percentage_of_income'] : SKIP # 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. LoanDisbursementsIndicators.new(amount: amount, iso_currency_code: iso_currency_code, unofficial_currency_code: unofficial_currency_code, category_details: category_details, monthly_average: monthly_average, top_providers: top_providers, transactions_count: transactions_count, monthly_summaries: monthly_summaries, days_since_last_occurrence: days_since_last_occurrence, percentage_of_income: percentage_of_income, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 78 def self.names @_hash = {} if @_hash.nil? @_hash['amount'] = 'amount' @_hash['iso_currency_code'] = 'iso_currency_code' @_hash['unofficial_currency_code'] = 'unofficial_currency_code' @_hash['category_details'] = 'category_details' @_hash['monthly_average'] = 'monthly_average' @_hash['top_providers'] = 'top_providers' @_hash['transactions_count'] = 'transactions_count' @_hash['monthly_summaries'] = 'monthly_summaries' @_hash['days_since_last_occurrence'] = 'days_since_last_occurrence' @_hash['percentage_of_income'] = 'percentage_of_income' @_hash end |
.nullables ⇒ Object
An array for nullable fields
110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 110 def self.nullables %w[ amount iso_currency_code unofficial_currency_code monthly_average transactions_count days_since_last_occurrence percentage_of_income ] end |
.optionals ⇒ Object
An array for optional fields
94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 94 def self.optionals %w[ amount iso_currency_code unofficial_currency_code category_details monthly_average top_providers transactions_count monthly_summaries days_since_last_occurrence percentage_of_income ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 221 def inspect class_name = self.class.name.split('::').last "<#{class_name} amount: #{@amount.inspect}, iso_currency_code:"\ " #{@iso_currency_code.inspect}, unofficial_currency_code:"\ " #{@unofficial_currency_code.inspect}, category_details: #{@category_details.inspect},"\ " monthly_average: #{@monthly_average.inspect}, top_providers: #{@top_providers.inspect},"\ " transactions_count: #{@transactions_count.inspect}, monthly_summaries:"\ " #{@monthly_summaries.inspect}, days_since_last_occurrence:"\ " #{@days_since_last_occurrence.inspect}, percentage_of_income:"\ " #{@percentage_of_income.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
209 210 211 212 213 214 215 216 217 218 |
# File 'lib/the_plaid_api/models/loan_disbursements_indicators.rb', line 209 def to_s class_name = self.class.name.split('::').last "<#{class_name} amount: #{@amount}, iso_currency_code: #{@iso_currency_code},"\ " unofficial_currency_code: #{@unofficial_currency_code}, category_details:"\ " #{@category_details}, monthly_average: #{@monthly_average}, top_providers:"\ " #{@top_providers}, transactions_count: #{@transactions_count}, monthly_summaries:"\ " #{@monthly_summaries}, days_since_last_occurrence: #{@days_since_last_occurrence},"\ " percentage_of_income: #{@percentage_of_income}, additional_properties:"\ " #{@additional_properties}>" end |