Class: ThePlaidApi::TransferOriginatorAddress
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::TransferOriginatorAddress
- Defined in:
- lib/the_plaid_api/models/transfer_originator_address.rb
Overview
The originator’s address.
Instance Attribute Summary collapse
-
#city ⇒ String
The full city name.
-
#country_code ⇒ String
ISO-3166-1 alpha-2 country code standard.
-
#postal_code ⇒ String
The postal code (e.g., “94103”).
-
#region ⇒ String
The two-letter code for the state or province (e.g., “CA”).
-
#street ⇒ String
The full street address.
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(city:, street:, region:, postal_code:, country_code:, additional_properties: nil) ⇒ TransferOriginatorAddress
constructor
A new instance of TransferOriginatorAddress.
-
#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(city:, street:, region:, postal_code:, country_code:, additional_properties: nil) ⇒ TransferOriginatorAddress
Returns a new instance of TransferOriginatorAddress.
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/the_plaid_api/models/transfer_originator_address.rb', line 53 def initialize(city:, street:, region:, postal_code:, country_code:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @city = city @street = street @region = region @postal_code = postal_code @country_code = country_code @additional_properties = additional_properties end |
Instance Attribute Details
#city ⇒ String
The full city name.
14 15 16 |
# File 'lib/the_plaid_api/models/transfer_originator_address.rb', line 14 def city @city end |
#country_code ⇒ String
ISO-3166-1 alpha-2 country code standard.
30 31 32 |
# File 'lib/the_plaid_api/models/transfer_originator_address.rb', line 30 def country_code @country_code end |
#postal_code ⇒ String
The postal code (e.g., “94103”).
26 27 28 |
# File 'lib/the_plaid_api/models/transfer_originator_address.rb', line 26 def postal_code @postal_code end |
#region ⇒ String
The two-letter code for the state or province (e.g., “CA”).
22 23 24 |
# File 'lib/the_plaid_api/models/transfer_originator_address.rb', line 22 def region @region end |
#street ⇒ String
The full street address.
18 19 20 |
# File 'lib/the_plaid_api/models/transfer_originator_address.rb', line 18 def street @street end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/the_plaid_api/models/transfer_originator_address.rb', line 67 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. city = hash.key?('city') ? hash['city'] : nil street = hash.key?('street') ? hash['street'] : nil region = hash.key?('region') ? hash['region'] : nil postal_code = hash.key?('postal_code') ? hash['postal_code'] : nil country_code = hash.key?('country_code') ? hash['country_code'] : 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. TransferOriginatorAddress.new(city: city, street: street, region: region, postal_code: postal_code, country_code: country_code, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/the_plaid_api/models/transfer_originator_address.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['city'] = 'city' @_hash['street'] = 'street' @_hash['region'] = 'region' @_hash['postal_code'] = 'postal_code' @_hash['country_code'] = 'country_code' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/the_plaid_api/models/transfer_originator_address.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 |
# File 'lib/the_plaid_api/models/transfer_originator_address.rb', line 44 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
102 103 104 105 106 107 |
# File 'lib/the_plaid_api/models/transfer_originator_address.rb', line 102 def inspect class_name = self.class.name.split('::').last "<#{class_name} city: #{@city.inspect}, street: #{@street.inspect}, region:"\ " #{@region.inspect}, postal_code: #{@postal_code.inspect}, country_code:"\ " #{@country_code.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
94 95 96 97 98 99 |
# File 'lib/the_plaid_api/models/transfer_originator_address.rb', line 94 def to_s class_name = self.class.name.split('::').last "<#{class_name} city: #{@city}, street: #{@street}, region: #{@region}, postal_code:"\ " #{@postal_code}, country_code: #{@country_code}, additional_properties:"\ " #{@additional_properties}>" end |