Class: Dhl::Intraship::PackstationAddress

Inherits:
CompanyAddress show all
Defined in:
lib/dhl-intraship/packstation_address.rb

Instance Attribute Summary collapse

Attributes inherited from CompanyAddress

#company

Attributes inherited from Address

#city, #contact_person, #country_code, #email, #house_number, #phone, #street, #street_additional, #zip

Instance Method Summary collapse

Methods inherited from Address

#company?, #initialize

Constructor Details

This class inherits a constructor from Dhl::Intraship::Address

Instance Attribute Details

#packstationObject

Returns the value of attribute packstation.



4
5
6
# File 'lib/dhl-intraship/packstation_address.rb', line 4

def packstation
  @packstation
end

#postnumberObject

Returns the value of attribute postnumber.



4
5
6
# File 'lib/dhl-intraship/packstation_address.rb', line 4

def postnumber
  @postnumber
end

Instance Method Details

#append_to_xml(xml) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/dhl-intraship/packstation_address.rb', line 6

def append_to_xml(xml)
  xml.Company do |xml|
    company_xml(xml)
  end
  # this element has no namespace
  xml.Packstation do |xml|
    xml.PackstationNumber packstation
    xml.PostNumber postnumber
    xml.Zip zip
    xml.City city
  end
  xml.Communication do |xml|
    xml.cis(:phone, phone) unless phone.blank?
    xml.cis(:email, email) unless email.blank?
    xml.cis(:contactPerson, contact_person.blank? ? "" : contact_person)
  end
end