Method: ActiveShipping::Location#initialize
- Defined in:
- lib/active_shipping/location.rb
#initialize(options = {}) ⇒ Location
Returns a new instance of Location.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/active_shipping/location.rb', line 26 def initialize( = {}) @country = ([:country].nil? or [:country].is_a?(ActiveUtils::Country)) ? [:country] : ActiveUtils::Country.find([:country]) @postal_code = [:postal_code] || [:postal] || [:zip] @province = [:province] || [:state] || [:territory] || [:region] @city = [:city] @name = [:name] @address1 = [:address1] @address2 = [:address2] @address3 = [:address3] @phone = [:phone] @fax = [:fax] @company_name = [:company_name] || [:company] self.address_type = [:address_type] end |