Class: Zaala::API::DeliveryAddress
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Zaala::API::DeliveryAddress
- Defined in:
- lib/zaala/api/types.rb
Overview
The class DeliveryAddress represents the delivery address of a purchase.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_message(h) ⇒ Object
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/zaala/api/types.rb', line 218 def self.(h) DeliveryAddress.new({ country: h[:country], city: h[:city], zip_code: h[:zipCode], address_add_on: h[:addressAddOn], house_number: h[:houseNumber], street: h[:street], street_extension: h[:streetExtension], company_name: h[:companyName], title: h[:title], first_name: h[:firstName], name: h[:name], }) end |
Instance Method Details
#to_message ⇒ Object
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
# File 'lib/zaala/api/types.rb', line 234 def m = { country: country, city: city, zipCode: zip_code } m[:addressAddOn] = address_add_on unless address_add_on.nil? m[:houseNumber] = house_number unless house_number.nil? m[:street] = street unless street.nil? m[:streetExtension] = street_extension unless street_extension.nil? m[:companyName] = company_name unless company_name.nil? m[:title] = title unless title.nil? m[:firstName] = first_name unless first_name.nil? m[:name] = name unless name.nil? m end |