Class: ShellDataReportingApIs::Address
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellDataReportingApIs::Address
- Defined in:
- lib/shell_data_reporting_ap_is/models/address.rb
Overview
Address Model.
Instance Attribute Summary collapse
-
#address_id ⇒ Integer
Address Id in cards platform.
-
#address_line1 ⇒ String
Address line1.
-
#address_line2 ⇒ String
Address line2.
-
#address_line3 ⇒ String
AddressLine3.
-
#city ⇒ String
City.
-
#country ⇒ String
Country for the address.
-
#country_iso_code ⇒ String
Country ISO code of the address.
-
#email_address ⇒ String
Email address of the address contact.
-
#fax ⇒ String
Fax number of the address contact.
-
#region_id ⇒ Integer
Region Id of the address.
-
#telephone ⇒ String
Telephone number of the address contact.
-
#zip_code ⇒ String
ZipCode.
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(address_id = SKIP, address_line1 = SKIP, address_line2 = SKIP, address_line3 = SKIP, zip_code = SKIP, city = SKIP, region_id = SKIP, country_iso_code = SKIP, country = SKIP, telephone = SKIP, email_address = SKIP, fax = SKIP) ⇒ Address
constructor
A new instance of Address.
Methods inherited from BaseModel
Constructor Details
#initialize(address_id = SKIP, address_line1 = SKIP, address_line2 = SKIP, address_line3 = SKIP, zip_code = SKIP, city = SKIP, region_id = SKIP, country_iso_code = SKIP, country = SKIP, telephone = SKIP, email_address = SKIP, fax = SKIP) ⇒ Address
Returns a new instance of Address.
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 114 def initialize(address_id = SKIP, address_line1 = SKIP, address_line2 = SKIP, address_line3 = SKIP, zip_code = SKIP, city = SKIP, region_id = SKIP, country_iso_code = SKIP, country = SKIP, telephone = SKIP, email_address = SKIP, fax = SKIP) @address_id = address_id unless address_id == SKIP @address_line1 = address_line1 unless address_line1 == SKIP @address_line2 = address_line2 unless address_line2 == SKIP @address_line3 = address_line3 unless address_line3 == SKIP @zip_code = zip_code unless zip_code == SKIP @city = city unless city == SKIP @region_id = region_id unless region_id == SKIP @country_iso_code = country_iso_code unless country_iso_code == SKIP @country = country unless country == SKIP @telephone = telephone unless telephone == SKIP @email_address = email_address unless email_address == SKIP @fax = fax unless fax == SKIP end |
Instance Attribute Details
#address_id ⇒ Integer
Address Id in cards platform.
14 15 16 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 14 def address_id @address_id end |
#address_line1 ⇒ String
Address line1
18 19 20 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 18 def address_line1 @address_line1 end |
#address_line2 ⇒ String
Address line2
22 23 24 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 22 def address_line2 @address_line2 end |
#address_line3 ⇒ String
AddressLine3
26 27 28 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 26 def address_line3 @address_line3 end |
#city ⇒ String
City
34 35 36 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 34 def city @city end |
#country ⇒ String
Country for the address
46 47 48 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 46 def country @country end |
#country_iso_code ⇒ String
Country ISO code of the address
42 43 44 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 42 def country_iso_code @country_iso_code end |
#email_address ⇒ String
Email address of the address contact
54 55 56 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 54 def email_address @email_address end |
#fax ⇒ String
Fax number of the address contact
58 59 60 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 58 def fax @fax end |
#region_id ⇒ Integer
Region Id of the address.
38 39 40 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 38 def region_id @region_id end |
#telephone ⇒ String
Telephone number of the address contact
50 51 52 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 50 def telephone @telephone end |
#zip_code ⇒ String
ZipCode
30 31 32 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 30 def zip_code @zip_code end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 134 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. address_id = hash.key?('AddressId') ? hash['AddressId'] : SKIP address_line1 = hash.key?('AddressLine1') ? hash['AddressLine1'] : SKIP address_line2 = hash.key?('AddressLine2') ? hash['AddressLine2'] : SKIP address_line3 = hash.key?('AddressLine3') ? hash['AddressLine3'] : SKIP zip_code = hash.key?('ZipCode') ? hash['ZipCode'] : SKIP city = hash.key?('City') ? hash['City'] : SKIP region_id = hash.key?('RegionId') ? hash['RegionId'] : SKIP country_iso_code = hash.key?('CountryISOCode') ? hash['CountryISOCode'] : SKIP country = hash.key?('Country') ? hash['Country'] : SKIP telephone = hash.key?('Telephone') ? hash['Telephone'] : SKIP email_address = hash.key?('EmailAddress') ? hash['EmailAddress'] : SKIP fax = hash.key?('Fax') ? hash['Fax'] : SKIP # Create object from extracted values. Address.new(address_id, address_line1, address_line2, address_line3, zip_code, city, region_id, country_iso_code, country, telephone, email_address, fax) end |
.names ⇒ Object
A mapping from model property names to API property names.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 61 def self.names @_hash = {} if @_hash.nil? @_hash['address_id'] = 'AddressId' @_hash['address_line1'] = 'AddressLine1' @_hash['address_line2'] = 'AddressLine2' @_hash['address_line3'] = 'AddressLine3' @_hash['zip_code'] = 'ZipCode' @_hash['city'] = 'City' @_hash['region_id'] = 'RegionId' @_hash['country_iso_code'] = 'CountryISOCode' @_hash['country'] = 'Country' @_hash['telephone'] = 'Telephone' @_hash['email_address'] = 'EmailAddress' @_hash['fax'] = 'Fax' @_hash end |
.nullables ⇒ Object
An array for nullable fields
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 97 def self.nullables %w[ address_id address_line1 address_line2 address_line3 zip_code city region_id country_iso_code country telephone email_address fax ] end |
.optionals ⇒ Object
An array for optional fields
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/shell_data_reporting_ap_is/models/address.rb', line 79 def self.optionals %w[ address_id address_line1 address_line2 address_line3 zip_code city region_id country_iso_code country telephone email_address fax ] end |