Class: Brownie::Shipper

Inherits:
Object
  • Object
show all
Defined in:
lib/brownie/shipper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#account_numberObject

Returns the value of attribute account_number.



3
4
5
# File 'lib/brownie/shipper.rb', line 3

def 
  @account_number
end

#address_line1Object

Returns the value of attribute address_line1.



3
4
5
# File 'lib/brownie/shipper.rb', line 3

def address_line1
  @address_line1
end

#address_line2Object

Returns the value of attribute address_line2.



3
4
5
# File 'lib/brownie/shipper.rb', line 3

def address_line2
  @address_line2
end

#cityObject

Returns the value of attribute city.



3
4
5
# File 'lib/brownie/shipper.rb', line 3

def city
  @city
end

#country_codeObject

Returns the value of attribute country_code.



3
4
5
# File 'lib/brownie/shipper.rb', line 3

def country_code
  @country_code
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/brownie/shipper.rb', line 3

def name
  @name
end

#phone_numberObject

Returns the value of attribute phone_number.



3
4
5
# File 'lib/brownie/shipper.rb', line 3

def phone_number
  @phone_number
end

#postal_codeObject

Returns the value of attribute postal_code.



3
4
5
# File 'lib/brownie/shipper.rb', line 3

def postal_code
  @postal_code
end

#shipper_numberObject

Returns the value of attribute shipper_number.



3
4
5
# File 'lib/brownie/shipper.rb', line 3

def shipper_number
  @shipper_number
end

#state_province_codeObject

Returns the value of attribute state_province_code.



3
4
5
# File 'lib/brownie/shipper.rb', line 3

def state_province_code
  @state_province_code
end

#tax_identification_numberObject

Returns the value of attribute tax_identification_number.



3
4
5
# File 'lib/brownie/shipper.rb', line 3

def tax_identification_number
  @tax_identification_number
end

Instance Method Details

#createObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/brownie/shipper.rb', line 9

def create
	data = Hash.from_xml(template)["Shipper"]
 			data["Name"] = self.name
 			data["PhoneNumber"] = self.phone_number
 			data["ShipperNumber"] = self.
 			data["TaxIdentificationNumber"] = self.tax_identification_number
  		data["Address"]["AddressLine1"] = self.address_line1
          data["Address"]["AddressLine2"] = self.address_line2 if !self.address_line2.nil?
  		data["Address"]["City"] = self.city
  		data["Address"]["StateProvinceCode"] = self.state_province_code
  		data["Address"]["PostalCode"] = self.postal_code
  		data["Address"]["CountryCode"] = self.country_code
  		return data
end