Class: ThePlaidApi::ProtectBankAccount

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/protect_bank_account.rb

Overview

Bank account information associated with the incident.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_id: SKIP, account_number: SKIP, routing_number: SKIP, additional_properties: nil) ⇒ ProtectBankAccount

Returns a new instance of ProtectBankAccount.



52
53
54
55
56
57
58
59
60
61
# File 'lib/the_plaid_api/models/protect_bank_account.rb', line 52

def initialize(account_id: SKIP, account_number: SKIP, routing_number: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @account_id =  unless  == SKIP
  @account_number =  unless  == SKIP
  @routing_number = routing_number unless routing_number == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_idString

Plaid’s unique identifier for the account.

Returns:

  • (String)


14
15
16
# File 'lib/the_plaid_api/models/protect_bank_account.rb', line 14

def 
  @account_id
end

#account_numberString

Full account number of the bank account.

Returns:

  • (String)


18
19
20
# File 'lib/the_plaid_api/models/protect_bank_account.rb', line 18

def 
  @account_number
end

#routing_numberString

Routing number of the bank account. Must be present if ‘account_number` is present.

Returns:

  • (String)


23
24
25
# File 'lib/the_plaid_api/models/protect_bank_account.rb', line 23

def routing_number
  @routing_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/the_plaid_api/models/protect_bank_account.rb', line 64

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('account_id') ? hash['account_id'] : SKIP
   =
    hash.key?('account_number') ? hash['account_number'] : SKIP
  routing_number =
    hash.key?('routing_number') ? hash['routing_number'] : 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.
  ProtectBankAccount.new(account_id: ,
                         account_number: ,
                         routing_number: routing_number,
                         additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



26
27
28
29
30
31
32
# File 'lib/the_plaid_api/models/protect_bank_account.rb', line 26

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_id'] = 'account_id'
  @_hash['account_number'] = 'account_number'
  @_hash['routing_number'] = 'routing_number'
  @_hash
end

.nullablesObject

An array for nullable fields



44
45
46
47
48
49
50
# File 'lib/the_plaid_api/models/protect_bank_account.rb', line 44

def self.nullables
  %w[
    account_id
    account_number
    routing_number
  ]
end

.optionalsObject

An array for optional fields



35
36
37
38
39
40
41
# File 'lib/the_plaid_api/models/protect_bank_account.rb', line 35

def self.optionals
  %w[
    account_id
    account_number
    routing_number
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



96
97
98
99
100
101
# File 'lib/the_plaid_api/models/protect_bank_account.rb', line 96

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id.inspect}, account_number:"\
  " #{@account_number.inspect}, routing_number: #{@routing_number.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



89
90
91
92
93
# File 'lib/the_plaid_api/models/protect_bank_account.rb', line 89

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id}, account_number: #{@account_number},"\
  " routing_number: #{@routing_number}, additional_properties: #{@additional_properties}>"
end