Class: Plaid::DistributionDetails
- Defined in:
- lib/plaid/models/distribution_details.rb
Overview
An object representing information about a distribution from the paycheck (for example, the amount distributed to a specific checking account, or to a retirement plan).
Instance Attribute Summary collapse
-
#account_number ⇒ String
The account number of the account being deposited to.
-
#bank_account_type ⇒ String
The type of bank account (e.g. Checking or Savings).
-
#bank_name ⇒ String
The name of the bank that the payment is being deposited to.
-
#current_pay ⇒ Pay
An object representing a monetary amount.
-
#description ⇒ String
A description of the distribution type.
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(account_number: SKIP, bank_account_type: SKIP, bank_name: SKIP, current_pay: SKIP, description: SKIP, additional_properties: nil) ⇒ DistributionDetails
constructor
A new instance of DistributionDetails.
-
#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(account_number: SKIP, bank_account_type: SKIP, bank_name: SKIP, current_pay: SKIP, description: SKIP, additional_properties: nil) ⇒ DistributionDetails
Returns a new instance of DistributionDetails.
66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/plaid/models/distribution_details.rb', line 66 def initialize(account_number: SKIP, bank_account_type: SKIP, bank_name: SKIP, current_pay: SKIP, description: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account_number = account_number unless account_number == SKIP @bank_account_type = bank_account_type unless bank_account_type == SKIP @bank_name = bank_name unless bank_name == SKIP @current_pay = current_pay unless current_pay == SKIP @description = description unless description == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_number ⇒ String
The account number of the account being deposited to.
16 17 18 |
# File 'lib/plaid/models/distribution_details.rb', line 16 def account_number @account_number end |
#bank_account_type ⇒ String
The type of bank account (e.g. Checking or Savings)
20 21 22 |
# File 'lib/plaid/models/distribution_details.rb', line 20 def bank_account_type @bank_account_type end |
#bank_name ⇒ String
The name of the bank that the payment is being deposited to.
24 25 26 |
# File 'lib/plaid/models/distribution_details.rb', line 24 def bank_name @bank_name end |
#current_pay ⇒ Pay
An object representing a monetary amount.
28 29 30 |
# File 'lib/plaid/models/distribution_details.rb', line 28 def current_pay @current_pay end |
#description ⇒ String
A description of the distribution type.
32 33 34 |
# File 'lib/plaid/models/distribution_details.rb', line 32 def description @description end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/plaid/models/distribution_details.rb', line 81 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_number = hash.key?('account_number') ? hash['account_number'] : SKIP bank_account_type = hash.key?('bank_account_type') ? hash['bank_account_type'] : SKIP bank_name = hash.key?('bank_name') ? hash['bank_name'] : SKIP current_pay = Pay.from_hash(hash['current_pay']) if hash['current_pay'] description = hash.key?('description') ? hash['description'] : 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. DistributionDetails.new(account_number: account_number, bank_account_type: bank_account_type, bank_name: bank_name, current_pay: current_pay, description: description, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
35 36 37 38 39 40 41 42 43 |
# File 'lib/plaid/models/distribution_details.rb', line 35 def self.names @_hash = {} if @_hash.nil? @_hash['account_number'] = 'account_number' @_hash['bank_account_type'] = 'bank_account_type' @_hash['bank_name'] = 'bank_name' @_hash['current_pay'] = 'current_pay' @_hash['description'] = 'description' @_hash end |
.nullables ⇒ Object
An array for nullable fields
57 58 59 60 61 62 63 64 |
# File 'lib/plaid/models/distribution_details.rb', line 57 def self.nullables %w[ account_number bank_account_type bank_name description ] end |
.optionals ⇒ Object
An array for optional fields
46 47 48 49 50 51 52 53 54 |
# File 'lib/plaid/models/distribution_details.rb', line 46 def self.optionals %w[ account_number bank_account_type bank_name current_pay description ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
118 119 120 121 122 123 124 |
# File 'lib/plaid/models/distribution_details.rb', line 118 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_number: #{@account_number.inspect}, bank_account_type:"\ " #{@bank_account_type.inspect}, bank_name: #{@bank_name.inspect}, current_pay:"\ " #{@current_pay.inspect}, description: #{@description.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
110 111 112 113 114 115 |
# File 'lib/plaid/models/distribution_details.rb', line 110 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_number: #{@account_number}, bank_account_type:"\ " #{@bank_account_type}, bank_name: #{@bank_name}, current_pay: #{@current_pay},"\ " description: #{@description}, additional_properties: #{@additional_properties}>" end |