Class: Blastramp::Address

Inherits:
Entity
  • Object
show all
Defined in:
lib/blastramp/address.rb

Instance Attribute Summary

Attributes inherited from Entity

#session

Instance Method Summary collapse

Methods inherited from Entity

has_properties, #initialize, #inspect, properties, #update_properties

Constructor Details

This class inherits a constructor from Blastramp::Entity

Instance Method Details

#initialize_defaultsObject



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

def initialize_defaults
  self.name = '' # Name as it appears on the ship to address label.
  self.line1 = '' # Street information (line 1) to appear on the ship to address label. Max total length of line1, line2 and line3 is 200 character
  self.line2 = ''
  self.line3 = ''
  self.city = '' # City name as on the ship to address label
  self.provstate = '' # Province/State as it appears on the ship to address label
  self.postalcode = '' # Postal or Zip code as it appears on the ship to address label
  self.country = 'CA' # Country name as it appears on the ship to address label.
  self.phone = '--' # Phone number (any format). If not known submit "--"
  self.fax = '--' # Fax number (any format). If not known submit "--"
  self.email = '--' # Email address. If not known submit "--"
  self.web = '--' # Web site URL If not known submit "--"
  self.contact = '' # Contact person's full name at the location.
end

#soap_dataObject

Returns OrderedHash with the properties of Address in the correct order, camelcased and ready to be sent via SOAP



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/blastramp/address.rb', line 23

def soap_data
  data = ActiveSupport::OrderedHash.new
  data['name'] = name 
  data['line1'] = line1
  data['line2'] = line2
  data['line3'] = line3
  data['city'] = city
  data['provstate'] = provstate
  data['postalcode'] = postalcode
  data['country'] = country
  data['phone'] = phone
  data['fax'] = fax
  data['email'] = email
  data['web'] = web
  data['contact'] = contact
        
  return data
end