Class: Dhl::Bcs::V2::Location

Inherits:
Object
  • Object
show all
Includes:
Buildable
Defined in:
lib/dhl/bcs/v2/location.rb

Overview

a location is one of Address, Packstation, Postfiliale or ParcelShop they have some properties in common

Direct Known Subclasses

Address, Packstation, ParcelShop, Postfiliale

Constant Summary collapse

PROPERTIES =
%i(zip city country country_code state).freeze

Instance Method Summary collapse

Methods included from Buildable

included, #initialize

Instance Method Details

#to_soap_hashObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/dhl/bcs/v2/location.rb', line 11

def to_soap_hash
  {
    'cis:zip' => zip,
    'cis:city' => city,
    'cis:Origin' => {}.tap { |h|
      h['cis:country'] = country if country
      h['cis:countryISOCode'] = country_code if country_code
      h['cis:state'] = state if state
    }
  }
end