Class: DHL::Ecommerce::StandardAddress

Inherits:
Base
  • Object
show all
Defined in:
lib/dhl/ecommerce/standard_address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ StandardAddress

Returns a new instance of StandardAddress.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/dhl/ecommerce/standard_address.rb', line 6

def initialize(attributes = {})
  super attributes

  unless attributes.empty?
    @name = attributes[:contact] if attributes[:contact]
    @name = attributes[:recipient] if attributes[:recipient]
    @firm = attributes[:account_name] if attributes[:account_name]
    @firm = attributes[:pickup_name] if attributes[:pickup_name]
    @address_1 = attributes[:address1] if attributes[:address1]
    @address_2 = attributes[:address2] if attributes[:address2]
  end
end

Instance Attribute Details

#address_1Object

Returns the value of attribute address_1.



4
5
6
# File 'lib/dhl/ecommerce/standard_address.rb', line 4

def address_1
  @address_1
end

#address_2Object

Returns the value of attribute address_2.



4
5
6
# File 'lib/dhl/ecommerce/standard_address.rb', line 4

def address_2
  @address_2
end

#cityObject

Returns the value of attribute city.



4
5
6
# File 'lib/dhl/ecommerce/standard_address.rb', line 4

def city
  @city
end

#countryObject

Returns the value of attribute country.



4
5
6
# File 'lib/dhl/ecommerce/standard_address.rb', line 4

def country
  @country
end

#firmObject

Returns the value of attribute firm.



4
5
6
# File 'lib/dhl/ecommerce/standard_address.rb', line 4

def firm
  @firm
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/dhl/ecommerce/standard_address.rb', line 4

def name
  @name
end

#postal_codeObject

Returns the value of attribute postal_code.



4
5
6
# File 'lib/dhl/ecommerce/standard_address.rb', line 4

def postal_code
  @postal_code
end

#stateObject

Returns the value of attribute state.



4
5
6
# File 'lib/dhl/ecommerce/standard_address.rb', line 4

def state
  @state
end