Class: ThePlaidApi::Numbers
- Defined in:
- lib/the_plaid_api/models/numbers.rb
Overview
Account and bank identifier number data used to configure the test account. All values are optional.
Instance Attribute Summary collapse
-
#account ⇒ String
Will be used for the account number.
-
#ach_routing ⇒ String
Must be a valid ACH routing number.
-
#ach_wire_routing ⇒ String
Must be a valid wire transfer routing number.
-
#bacs_sort_code ⇒ String
BACS sort code.
-
#eft_branch ⇒ String
EFT branch number.
-
#eft_institution ⇒ String
EFT institution number.
-
#international_bic ⇒ String
Bank identifier code (BIC).
-
#international_iban ⇒ String
International bank account number (IBAN).
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: SKIP, ach_routing: SKIP, ach_wire_routing: SKIP, eft_institution: SKIP, eft_branch: SKIP, international_bic: SKIP, international_iban: SKIP, bacs_sort_code: SKIP, additional_properties: nil) ⇒ Numbers
constructor
A new instance of Numbers.
-
#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: SKIP, ach_routing: SKIP, ach_wire_routing: SKIP, eft_institution: SKIP, eft_branch: SKIP, international_bic: SKIP, international_iban: SKIP, bacs_sort_code: SKIP, additional_properties: nil) ⇒ Numbers
Returns a new instance of Numbers.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/the_plaid_api/models/numbers.rb', line 82 def initialize(account: SKIP, ach_routing: SKIP, ach_wire_routing: SKIP, eft_institution: SKIP, eft_branch: SKIP, international_bic: SKIP, international_iban: SKIP, bacs_sort_code: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account = account unless account == SKIP @ach_routing = ach_routing unless ach_routing == SKIP @ach_wire_routing = ach_wire_routing unless ach_wire_routing == SKIP @eft_institution = eft_institution unless eft_institution == SKIP @eft_branch = eft_branch unless eft_branch == SKIP @international_bic = international_bic unless international_bic == SKIP @international_iban = international_iban unless international_iban == SKIP @bacs_sort_code = bacs_sort_code unless bacs_sort_code == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account ⇒ String
Will be used for the account number.
15 16 17 |
# File 'lib/the_plaid_api/models/numbers.rb', line 15 def account @account end |
#ach_routing ⇒ String
Must be a valid ACH routing number. To test ‘/transfer/capabilities/get`, set this to 322271627 to force a `true` result.
20 21 22 |
# File 'lib/the_plaid_api/models/numbers.rb', line 20 def ach_routing @ach_routing end |
#ach_wire_routing ⇒ String
Must be a valid wire transfer routing number.
24 25 26 |
# File 'lib/the_plaid_api/models/numbers.rb', line 24 def ach_wire_routing @ach_wire_routing end |
#bacs_sort_code ⇒ String
BACS sort code
47 48 49 |
# File 'lib/the_plaid_api/models/numbers.rb', line 47 def bacs_sort_code @bacs_sort_code end |
#eft_branch ⇒ String
EFT branch number. Must be specified alongside ‘eft_institution`.
32 33 34 |
# File 'lib/the_plaid_api/models/numbers.rb', line 32 def eft_branch @eft_branch end |
#eft_institution ⇒ String
EFT institution number. Must be specified alongside ‘eft_branch`.
28 29 30 |
# File 'lib/the_plaid_api/models/numbers.rb', line 28 def eft_institution @eft_institution end |
#international_bic ⇒ String
Bank identifier code (BIC). Must be specified alongside ‘international_iban`.
37 38 39 |
# File 'lib/the_plaid_api/models/numbers.rb', line 37 def international_bic @international_bic end |
#international_iban ⇒ String
International bank account number (IBAN). If no account number is specified via ‘account`, will also be used as the account number by default. Must be specified alongside `international_bic`.
43 44 45 |
# File 'lib/the_plaid_api/models/numbers.rb', line 43 def international_iban @international_iban end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/the_plaid_api/models/numbers.rb', line 101 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account = hash.key?('account') ? hash['account'] : SKIP ach_routing = hash.key?('ach_routing') ? hash['ach_routing'] : SKIP ach_wire_routing = hash.key?('ach_wire_routing') ? hash['ach_wire_routing'] : SKIP eft_institution = hash.key?('eft_institution') ? hash['eft_institution'] : SKIP eft_branch = hash.key?('eft_branch') ? hash['eft_branch'] : SKIP international_bic = hash.key?('international_bic') ? hash['international_bic'] : SKIP international_iban = hash.key?('international_iban') ? hash['international_iban'] : SKIP bacs_sort_code = hash.key?('bacs_sort_code') ? hash['bacs_sort_code'] : 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. Numbers.new(account: account, ach_routing: ach_routing, ach_wire_routing: ach_wire_routing, eft_institution: eft_institution, eft_branch: eft_branch, international_bic: international_bic, international_iban: international_iban, bacs_sort_code: bacs_sort_code, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/the_plaid_api/models/numbers.rb', line 50 def self.names @_hash = {} if @_hash.nil? @_hash['account'] = 'account' @_hash['ach_routing'] = 'ach_routing' @_hash['ach_wire_routing'] = 'ach_wire_routing' @_hash['eft_institution'] = 'eft_institution' @_hash['eft_branch'] = 'eft_branch' @_hash['international_bic'] = 'international_bic' @_hash['international_iban'] = 'international_iban' @_hash['bacs_sort_code'] = 'bacs_sort_code' @_hash end |
.nullables ⇒ Object
An array for nullable fields
78 79 80 |
# File 'lib/the_plaid_api/models/numbers.rb', line 78 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/the_plaid_api/models/numbers.rb', line 64 def self.optionals %w[ account ach_routing ach_wire_routing eft_institution eft_branch international_bic international_iban bacs_sort_code ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
148 149 150 151 152 153 154 155 156 |
# File 'lib/the_plaid_api/models/numbers.rb', line 148 def inspect class_name = self.class.name.split('::').last "<#{class_name} account: #{@account.inspect}, ach_routing: #{@ach_routing.inspect},"\ " ach_wire_routing: #{@ach_wire_routing.inspect}, eft_institution:"\ " #{@eft_institution.inspect}, eft_branch: #{@eft_branch.inspect}, international_bic:"\ " #{@international_bic.inspect}, international_iban: #{@international_iban.inspect},"\ " bacs_sort_code: #{@bacs_sort_code.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
139 140 141 142 143 144 145 |
# File 'lib/the_plaid_api/models/numbers.rb', line 139 def to_s class_name = self.class.name.split('::').last "<#{class_name} account: #{@account}, ach_routing: #{@ach_routing}, ach_wire_routing:"\ " #{@ach_wire_routing}, eft_institution: #{@eft_institution}, eft_branch: #{@eft_branch},"\ " international_bic: #{@international_bic}, international_iban: #{@international_iban},"\ " bacs_sort_code: #{@bacs_sort_code}, additional_properties: #{@additional_properties}>" end |