Class: Plaid::StandaloneAccountType
- Defined in:
- lib/plaid/models/standalone_account_type.rb
Overview
The schema below describes the various ‘types` and corresponding `subtypes` that Plaid recognizes and reports for financial institution accounts.
Instance Attribute Summary collapse
-
#credit ⇒ CreditAccount
A credit card type account.
-
#depository ⇒ DepositoryAccount
An account type holding cash, in which funds are deposited.
-
#investment ⇒ InvestmentAccountSubtype
An investment account.
-
#loan ⇒ LoanAccount
A loan type account.
-
#other ⇒ String
Other or unknown account 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(depository:, credit:, loan:, investment:, other:, additional_properties: nil) ⇒ StandaloneAccountType
constructor
A new instance of StandaloneAccountType.
-
#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(depository:, credit:, loan:, investment:, other:, additional_properties: nil) ⇒ StandaloneAccountType
Returns a new instance of StandaloneAccountType.
60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/plaid/models/standalone_account_type.rb', line 60 def initialize(depository:, credit:, loan:, investment:, other:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @depository = depository @credit = credit @loan = loan @investment = investment @other = other @additional_properties = additional_properties end |
Instance Attribute Details
#credit ⇒ CreditAccount
A credit card type account. Supported products for ‘credit` accounts are: Balance, Transactions, Identity, and Liabilities.
22 23 24 |
# File 'lib/plaid/models/standalone_account_type.rb', line 22 def credit @credit end |
#depository ⇒ DepositoryAccount
An account type holding cash, in which funds are deposited. Supported products for ‘depository` accounts are: Auth, Balance, Transactions, Identity, Payment Initiation, and Assets.
17 18 19 |
# File 'lib/plaid/models/standalone_account_type.rb', line 17 def depository @depository end |
#investment ⇒ InvestmentAccountSubtype
An investment account. Supported products for ‘investment` accounts are: Balance and Investments.
32 33 34 |
# File 'lib/plaid/models/standalone_account_type.rb', line 32 def investment @investment end |
#loan ⇒ LoanAccount
A loan type account. Supported products for ‘loan` accounts are: Balance, Liabilities, and Transactions.
27 28 29 |
# File 'lib/plaid/models/standalone_account_type.rb', line 27 def loan @loan end |
#other ⇒ String
Other or unknown account type. Supported products for ‘other` accounts are: Balance, Transactions, Identity, and Assets.
37 38 39 |
# File 'lib/plaid/models/standalone_account_type.rb', line 37 def other @other end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/plaid/models/standalone_account_type.rb', line 74 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. depository = DepositoryAccount.from_hash(hash['depository']) if hash['depository'] credit = CreditAccount.from_hash(hash['credit']) if hash['credit'] loan = LoanAccount.from_hash(hash['loan']) if hash['loan'] investment = InvestmentAccountSubtype.from_hash(hash['investment']) if hash['investment'] 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. StandaloneAccountType.new(depository: depository, credit: credit, loan: loan, investment: investment, other: other, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
40 41 42 43 44 45 46 47 48 |
# File 'lib/plaid/models/standalone_account_type.rb', line 40 def self.names @_hash = {} if @_hash.nil? @_hash['depository'] = 'depository' @_hash['credit'] = 'credit' @_hash['loan'] = 'loan' @_hash['investment'] = 'investment' @_hash['other'] = 'other' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 |
# File 'lib/plaid/models/standalone_account_type.rb', line 56 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
51 52 53 |
# File 'lib/plaid/models/standalone_account_type.rb', line 51 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
108 109 110 111 112 113 |
# File 'lib/plaid/models/standalone_account_type.rb', line 108 def inspect class_name = self.class.name.split('::').last "<#{class_name} depository: #{@depository.inspect}, credit: #{@credit.inspect}, loan:"\ " #{@loan.inspect}, investment: #{@investment.inspect}, other: #{@other.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
101 102 103 104 105 |
# File 'lib/plaid/models/standalone_account_type.rb', line 101 def to_s class_name = self.class.name.split('::').last "<#{class_name} depository: #{@depository}, credit: #{@credit}, loan: #{@loan}, investment:"\ " #{@investment}, other: #{@other}, additional_properties: #{@additional_properties}>" end |