Class: DHL::Ecommerce::Location

Inherits:
Base
  • Object
show all
Includes:
Operations::Find, Operations::List
Defined in:
lib/dhl/ecommerce/location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Operations::List

included

Methods included from Operations::Find

included

Constructor Details

#initialize(attributes = {}) ⇒ Location

Returns a new instance of Location.



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

def initialize(attributes = {})
  super attributes

  unless attributes.empty?
    @id = attributes[:pickup].to_i if attributes[:pickup]
    @account_id = attributes[:account].to_i if attributes[:account]
    @address = StandardAddress.new attributes
  end
end

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



7
8
9
# File 'lib/dhl/ecommerce/location.rb', line 7

def 
  @account_id
end

#addressObject (readonly)

Returns the value of attribute address.



7
8
9
# File 'lib/dhl/ecommerce/location.rb', line 7

def address
  @address
end

#emailObject (readonly)

Returns the value of attribute email.



7
8
9
# File 'lib/dhl/ecommerce/location.rb', line 7

def email
  @email
end

#faxObject (readonly)

Returns the value of attribute fax.



7
8
9
# File 'lib/dhl/ecommerce/location.rb', line 7

def fax
  @fax
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/dhl/ecommerce/location.rb', line 7

def id
  @id
end

#phoneObject (readonly)

Returns the value of attribute phone.



7
8
9
# File 'lib/dhl/ecommerce/location.rb', line 7

def phone
  @phone
end

Instance Method Details

#accountObject



19
20
21
# File 'lib/dhl/ecommerce/location.rb', line 19

def 
  @account ||= DHL::Ecommerce::Account.find()
end