Class: ThePlaidApi::UserDataOverview
- Defined in:
- lib/the_plaid_api/models/user_data_overview.rb
Overview
metadata for the set of insights provided in ‘TransactionsUserInsightsGetResponse`
Instance Attribute Summary collapse
-
#days_available ⇒ Integer
The range of days of transactions available.
-
#newest_transaction_date ⇒ Date
The date of the newest transaction processed to generate insights.
-
#oldest_transaction_date ⇒ Date
The date of the oldest transaction processed to generate insights.
-
#total_inflows ⇒ Float
Sum of inflow amounts.
-
#total_outflows ⇒ Float
Sum of outflow amounts.
-
#transaction_count ⇒ Integer
The total number of transactions.
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(transaction_count:, days_available:, total_outflows:, total_inflows:, oldest_transaction_date: SKIP, newest_transaction_date: SKIP, additional_properties: nil) ⇒ UserDataOverview
constructor
A new instance of UserDataOverview.
-
#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(transaction_count:, days_available:, total_outflows:, total_inflows:, oldest_transaction_date: SKIP, newest_transaction_date: SKIP, additional_properties: nil) ⇒ UserDataOverview
Returns a new instance of UserDataOverview.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/the_plaid_api/models/user_data_overview.rb', line 62 def initialize(transaction_count:, days_available:, total_outflows:, total_inflows:, oldest_transaction_date: SKIP, newest_transaction_date: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @transaction_count = transaction_count @oldest_transaction_date = oldest_transaction_date unless oldest_transaction_date == SKIP @newest_transaction_date = newest_transaction_date unless newest_transaction_date == SKIP @days_available = days_available @total_outflows = total_outflows @total_inflows = total_inflows @additional_properties = additional_properties end |
Instance Attribute Details
#days_available ⇒ Integer
The range of days of transactions available.
27 28 29 |
# File 'lib/the_plaid_api/models/user_data_overview.rb', line 27 def days_available @days_available end |
#newest_transaction_date ⇒ Date
The date of the newest transaction processed to generate insights.
23 24 25 |
# File 'lib/the_plaid_api/models/user_data_overview.rb', line 23 def newest_transaction_date @newest_transaction_date end |
#oldest_transaction_date ⇒ Date
The date of the oldest transaction processed to generate insights.
19 20 21 |
# File 'lib/the_plaid_api/models/user_data_overview.rb', line 19 def oldest_transaction_date @oldest_transaction_date end |
#total_inflows ⇒ Float
Sum of inflow amounts.
35 36 37 |
# File 'lib/the_plaid_api/models/user_data_overview.rb', line 35 def total_inflows @total_inflows end |
#total_outflows ⇒ Float
Sum of outflow amounts.
31 32 33 |
# File 'lib/the_plaid_api/models/user_data_overview.rb', line 31 def total_outflows @total_outflows end |
#transaction_count ⇒ Integer
The total number of transactions.
15 16 17 |
# File 'lib/the_plaid_api/models/user_data_overview.rb', line 15 def transaction_count @transaction_count end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/the_plaid_api/models/user_data_overview.rb', line 78 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. transaction_count = hash.key?('transaction_count') ? hash['transaction_count'] : nil days_available = hash.key?('days_available') ? hash['days_available'] : nil total_outflows = hash.key?('total_outflows') ? hash['total_outflows'] : nil total_inflows = hash.key?('total_inflows') ? hash['total_inflows'] : nil oldest_transaction_date = hash.key?('oldest_transaction_date') ? hash['oldest_transaction_date'] : SKIP newest_transaction_date = hash.key?('newest_transaction_date') ? hash['newest_transaction_date'] : 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. UserDataOverview.new(transaction_count: transaction_count, days_available: days_available, total_outflows: total_outflows, total_inflows: total_inflows, oldest_transaction_date: oldest_transaction_date, newest_transaction_date: newest_transaction_date, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/the_plaid_api/models/user_data_overview.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['transaction_count'] = 'transaction_count' @_hash['oldest_transaction_date'] = 'oldest_transaction_date' @_hash['newest_transaction_date'] = 'newest_transaction_date' @_hash['days_available'] = 'days_available' @_hash['total_outflows'] = 'total_outflows' @_hash['total_inflows'] = 'total_inflows' @_hash end |
.nullables ⇒ Object
An array for nullable fields
58 59 60 |
# File 'lib/the_plaid_api/models/user_data_overview.rb', line 58 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
50 51 52 53 54 55 |
# File 'lib/the_plaid_api/models/user_data_overview.rb', line 50 def self.optionals %w[ oldest_transaction_date newest_transaction_date ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
121 122 123 124 125 126 127 128 |
# File 'lib/the_plaid_api/models/user_data_overview.rb', line 121 def inspect class_name = self.class.name.split('::').last "<#{class_name} transaction_count: #{@transaction_count.inspect}, oldest_transaction_date:"\ " #{@oldest_transaction_date.inspect}, newest_transaction_date:"\ " #{@newest_transaction_date.inspect}, days_available: #{@days_available.inspect},"\ " total_outflows: #{@total_outflows.inspect}, total_inflows: #{@total_inflows.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
112 113 114 115 116 117 118 |
# File 'lib/the_plaid_api/models/user_data_overview.rb', line 112 def to_s class_name = self.class.name.split('::').last "<#{class_name} transaction_count: #{@transaction_count}, oldest_transaction_date:"\ " #{@oldest_transaction_date}, newest_transaction_date: #{@newest_transaction_date},"\ " days_available: #{@days_available}, total_outflows: #{@total_outflows}, total_inflows:"\ " #{@total_inflows}, additional_properties: #{@additional_properties}>" end |