class Dhl::Contact

Attributes

address[RW]
address2[RW]
address3[RW]
city[RW]
company[RW]
country_code[RW]
email[RW]
name[RW]
phone[RW]
postal_code[RW]
state_name[RW]
street_name[RW]
street_number[RW]

Public Instance Methods

to_hash() click to toggle source
# File lib/dhl/contact.rb, line 7
def to_hash
  {
    contact: {
      person_name: @name,
      company_name: @company,
      phone_number: @phone,
      email_address: @email # Optional
    }.remove_empty,
    address: {
      street_lines: @address,
      street_lines_2: @address2, # Optional
      street_lines_3: @address3, # Optional
      city: @city,
      postal_code: @postal_code,
      country_code: @country_code,
      street_name: @street_name, # Optional
      street_number: @street_number, # Optional
      state_or_province_code: @state_name # Optional
    }.remove_empty
  }
end