Class: ThePlaidApi::CreditPayStubAddress
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::CreditPayStubAddress
- Defined in:
- lib/the_plaid_api/models/credit_pay_stub_address.rb
Overview
Address on the pay stub.
Instance Attribute Summary collapse
-
#city ⇒ String
The full city name.
-
#country ⇒ String
The ISO 3166-1 alpha-2 country code.
-
#postal_code ⇒ String
The postal code of the address.
-
#region ⇒ String
The region or state.
-
#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:, country:, postal_code:, region:, street:, additional_properties: nil) ⇒ CreditPayStubAddress
constructor
A new instance of CreditPayStubAddress.
-
#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:, country:, postal_code:, region:, street:, additional_properties: nil) ⇒ CreditPayStubAddress
Returns a new instance of CreditPayStubAddress.
60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/the_plaid_api/models/credit_pay_stub_address.rb', line 60 def initialize(city:, country:, postal_code:, region:, street:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @city = city @country = country @postal_code = postal_code @region = region @street = street @additional_properties = additional_properties end |
Instance Attribute Details
#city ⇒ String
The full city name.
14 15 16 |
# File 'lib/the_plaid_api/models/credit_pay_stub_address.rb', line 14 def city @city end |
#country ⇒ String
The ISO 3166-1 alpha-2 country code.
18 19 20 |
# File 'lib/the_plaid_api/models/credit_pay_stub_address.rb', line 18 def country @country end |
#postal_code ⇒ String
The postal code of the address.
22 23 24 |
# File 'lib/the_plaid_api/models/credit_pay_stub_address.rb', line 22 def postal_code @postal_code end |
#region ⇒ String
The region or state. Example: ‘“NC”`
27 28 29 |
# File 'lib/the_plaid_api/models/credit_pay_stub_address.rb', line 27 def region @region end |
#street ⇒ String
The full street address.
31 32 33 |
# File 'lib/the_plaid_api/models/credit_pay_stub_address.rb', line 31 def street @street 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/the_plaid_api/models/credit_pay_stub_address.rb', line 74 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. city = hash.key?('city') ? hash['city'] : nil country = hash.key?('country') ? hash['country'] : nil postal_code = hash.key?('postal_code') ? hash['postal_code'] : nil region = hash.key?('region') ? hash['region'] : nil street = hash.key?('street') ? hash['street'] : 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. CreditPayStubAddress.new(city: city, country: country, postal_code: postal_code, region: region, street: street, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/the_plaid_api/models/credit_pay_stub_address.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['city'] = 'city' @_hash['country'] = 'country' @_hash['postal_code'] = 'postal_code' @_hash['region'] = 'region' @_hash['street'] = 'street' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 53 54 55 56 57 58 |
# File 'lib/the_plaid_api/models/credit_pay_stub_address.rb', line 50 def self.nullables %w[ city country postal_code region street ] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 |
# File 'lib/the_plaid_api/models/credit_pay_stub_address.rb', line 45 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/the_plaid_api/models/credit_pay_stub_address.rb', line 108 def inspect class_name = self.class.name.split('::').last "<#{class_name} city: #{@city.inspect}, country: #{@country.inspect}, postal_code:"\ " #{@postal_code.inspect}, region: #{@region.inspect}, street: #{@street.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/the_plaid_api/models/credit_pay_stub_address.rb', line 101 def to_s class_name = self.class.name.split('::').last "<#{class_name} city: #{@city}, country: #{@country}, postal_code: #{@postal_code}, region:"\ " #{@region}, street: #{@street}, additional_properties: #{@additional_properties}>" end |