Class: NewStoreApi::AddressDataIeV1Dto
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::AddressDataIeV1Dto
- Defined in:
- lib/new_store_api/models/address_data_ie_v1_dto.rb
Overview
AddressDataIeV1Dto Model.
Instance Attribute Summary collapse
-
#address ⇒ String
Address of the legal entity.
-
#city ⇒ String
City of the legal entity.
-
#country ⇒ String
City of the legal entity.
-
#postal_code ⇒ String
Postal code of the legal entity.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(address = nil, city = nil, country = nil, postal_code = nil) ⇒ AddressDataIeV1Dto
constructor
A new instance of AddressDataIeV1Dto.
-
#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(address = nil, city = nil, country = nil, postal_code = nil) ⇒ AddressDataIeV1Dto
Returns a new instance of AddressDataIeV1Dto.
48 49 50 51 52 53 |
# File 'lib/new_store_api/models/address_data_ie_v1_dto.rb', line 48 def initialize(address = nil, city = nil, country = nil, postal_code = nil) @address = address @city = city @country = country @postal_code = postal_code end |
Instance Attribute Details
#address ⇒ String
Address of the legal entity.
14 15 16 |
# File 'lib/new_store_api/models/address_data_ie_v1_dto.rb', line 14 def address @address end |
#city ⇒ String
City of the legal entity.
18 19 20 |
# File 'lib/new_store_api/models/address_data_ie_v1_dto.rb', line 18 def city @city end |
#country ⇒ String
City of the legal entity.
22 23 24 |
# File 'lib/new_store_api/models/address_data_ie_v1_dto.rb', line 22 def country @country end |
#postal_code ⇒ String
Postal code of the legal entity.
26 27 28 |
# File 'lib/new_store_api/models/address_data_ie_v1_dto.rb', line 26 def postal_code @postal_code end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/new_store_api/models/address_data_ie_v1_dto.rb', line 56 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. address = hash.key?('address') ? hash['address'] : nil city = hash.key?('city') ? hash['city'] : nil country = hash.key?('country') ? hash['country'] : nil postal_code = hash.key?('postal_code') ? hash['postal_code'] : nil # Create object from extracted values. AddressDataIeV1Dto.new(address, city, country, postal_code) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/new_store_api/models/address_data_ie_v1_dto.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['address'] = 'address' @_hash['city'] = 'city' @_hash['country'] = 'country' @_hash['postal_code'] = 'postal_code' @_hash end |
.nullables ⇒ Object
An array for nullable fields
44 45 46 |
# File 'lib/new_store_api/models/address_data_ie_v1_dto.rb', line 44 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 |
# File 'lib/new_store_api/models/address_data_ie_v1_dto.rb', line 39 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
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 99 100 |
# File 'lib/new_store_api/models/address_data_ie_v1_dto.rb', line 74 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.address, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.city, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.country, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.postal_code, ->(val) { val.instance_of? String }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['address'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['city'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['country'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['postal_code'], ->(val) { val.instance_of? String }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
110 111 112 113 114 |
# File 'lib/new_store_api/models/address_data_ie_v1_dto.rb', line 110 def inspect class_name = self.class.name.split('::').last "<#{class_name} address: #{@address.inspect}, city: #{@city.inspect}, country:"\ " #{@country.inspect}, postal_code: #{@postal_code.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
103 104 105 106 107 |
# File 'lib/new_store_api/models/address_data_ie_v1_dto.rb', line 103 def to_s class_name = self.class.name.split('::').last "<#{class_name} address: #{@address}, city: #{@city}, country: #{@country}, postal_code:"\ " #{@postal_code}>" end |