Class: Brownie::ShipFrom

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#address_line1Object

Returns the value of attribute address_line1.



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

def address_line1
  @address_line1
end

#address_line2Object

Returns the value of attribute address_line2.



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

def address_line2
  @address_line2
end

#attention_nameObject

Returns the value of attribute attention_name.



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

def attention_name
  @attention_name
end

#cityObject

Returns the value of attribute city.



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

def city
  @city
end

#company_nameObject

Returns the value of attribute company_name.



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

def company_name
  @company_name
end

#country_codeObject

Returns the value of attribute country_code.



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

def country_code
  @country_code
end

#phone_numberObject

Returns the value of attribute phone_number.



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

def phone_number
  @phone_number
end

#postal_codeObject

Returns the value of attribute postal_code.



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

def postal_code
  @postal_code
end

#state_province_codeObject

Returns the value of attribute state_province_code.



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

def state_province_code
  @state_province_code
end

Instance Method Details

#createObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/brownie/ship_from.rb', line 6

def create
	data = Hash.from_xml(template)["ShipFrom"]	
          data["CompanyName"] = self.company_name
          data["AttentionName"] = self.attention_name
          data["PhoneNumber"] = self.phone_number
          data["AttentionName"] = self.attention_name
          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