Class: ThePlaidApi::TransferUserAddressInResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::TransferUserAddressInResponse
- Defined in:
- lib/the_plaid_api/models/transfer_user_address_in_response.rb
Overview
The address associated with the account holder.
Instance Attribute Summary collapse
-
#city ⇒ String
Ex.
-
#country ⇒ String
A two-letter country code (e.g., “US”).
-
#postal_code ⇒ String
The postal code (e.g., “94103”).
-
#region ⇒ String
The state or province (e.g., “CA”).
-
#street ⇒ String
The street number and name (i.e., “100 Market St.”).
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(street:, city:, region:, postal_code:, country:, additional_properties: nil) ⇒ TransferUserAddressInResponse
constructor
A new instance of TransferUserAddressInResponse.
-
#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(street:, city:, region:, postal_code:, country:, additional_properties: nil) ⇒ TransferUserAddressInResponse
Returns a new instance of TransferUserAddressInResponse.
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/the_plaid_api/models/transfer_user_address_in_response.rb', line 59 def initialize(street:, city:, region:, postal_code:, country:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @street = street @city = city @region = region @postal_code = postal_code @country = country @additional_properties = additional_properties end |
Instance Attribute Details
#city ⇒ String
Ex. “San Francisco”
18 19 20 |
# File 'lib/the_plaid_api/models/transfer_user_address_in_response.rb', line 18 def city @city end |
#country ⇒ String
A two-letter country code (e.g., “US”).
30 31 32 |
# File 'lib/the_plaid_api/models/transfer_user_address_in_response.rb', line 30 def country @country end |
#postal_code ⇒ String
The postal code (e.g., “94103”).
26 27 28 |
# File 'lib/the_plaid_api/models/transfer_user_address_in_response.rb', line 26 def postal_code @postal_code end |
#region ⇒ String
The state or province (e.g., “CA”).
22 23 24 |
# File 'lib/the_plaid_api/models/transfer_user_address_in_response.rb', line 22 def region @region end |
#street ⇒ String
The street number and name (i.e., “100 Market St.”).
14 15 16 |
# File 'lib/the_plaid_api/models/transfer_user_address_in_response.rb', line 14 def street @street end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/the_plaid_api/models/transfer_user_address_in_response.rb', line 73 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. street = hash.key?('street') ? hash['street'] : nil city = hash.key?('city') ? hash['city'] : nil region = hash.key?('region') ? hash['region'] : nil postal_code = hash.key?('postal_code') ? hash['postal_code'] : nil country = hash.key?('country') ? hash['country'] : 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. TransferUserAddressInResponse.new(street: street, city: city, region: region, postal_code: postal_code, country: country, 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_user_address_in_response.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['street'] = 'street' @_hash['city'] = 'city' @_hash['region'] = 'region' @_hash['postal_code'] = 'postal_code' @_hash['country'] = 'country' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 52 53 54 55 56 57 |
# File 'lib/the_plaid_api/models/transfer_user_address_in_response.rb', line 49 def self.nullables %w[ street city region postal_code country ] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 |
# File 'lib/the_plaid_api/models/transfer_user_address_in_response.rb', line 44 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
107 108 109 110 111 112 |
# File 'lib/the_plaid_api/models/transfer_user_address_in_response.rb', line 107 def inspect class_name = self.class.name.split('::').last "<#{class_name} street: #{@street.inspect}, city: #{@city.inspect}, region:"\ " #{@region.inspect}, postal_code: #{@postal_code.inspect}, country: #{@country.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
100 101 102 103 104 |
# File 'lib/the_plaid_api/models/transfer_user_address_in_response.rb', line 100 def to_s class_name = self.class.name.split('::').last "<#{class_name} street: #{@street}, city: #{@city}, region: #{@region}, postal_code:"\ " #{@postal_code}, country: #{@country}, additional_properties: #{@additional_properties}>" end |