Class: UpsPickup::PickupAddress
- Defined in:
- lib/ups_pickup/address.rb
Constant Summary collapse
- ADDRESS_TYPES =
{:residential=>"Y",:commercial=>"N"}
Instance Attribute Summary collapse
-
#company_name ⇒ Object
Returns the value of attribute company_name.
-
#contact_name ⇒ Object
Returns the value of attribute contact_name.
-
#extension ⇒ Object
Returns the value of attribute extension.
-
#floor ⇒ Object
Returns the value of attribute floor.
-
#phone_number ⇒ Object
Returns the value of attribute phone_number.
-
#pickup_point ⇒ Object
Returns the value of attribute pickup_point.
-
#residential_indicator ⇒ Object
Returns the value of attribute residential_indicator.
-
#room ⇒ Object
Returns the value of attribute room.
Attributes inherited from Address
#address_line, #city, #country, #country_code, #postal_code, #state
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PickupAddress
constructor
A new instance of PickupAddress.
- #to_ups_hash ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ PickupAddress
Returns a new instance of PickupAddress.
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/ups_pickup/address.rb', line 30 def initialize(={}) super() @company_name =[:company_name] @contact_name = [:contact_name] @room = [:room] @floor = [:floor] @residential_indicator = [:residential_indicator] || "N" #ADDRESS_TYPES[options[:type]] @pickup_point = [:pickup_point] @phone_number = [:phone_number] @extension = [:extension] end |
Instance Attribute Details
#company_name ⇒ Object
Returns the value of attribute company_name.
29 30 31 |
# File 'lib/ups_pickup/address.rb', line 29 def company_name @company_name end |
#contact_name ⇒ Object
Returns the value of attribute contact_name.
29 30 31 |
# File 'lib/ups_pickup/address.rb', line 29 def contact_name @contact_name end |
#extension ⇒ Object
Returns the value of attribute extension.
29 30 31 |
# File 'lib/ups_pickup/address.rb', line 29 def extension @extension end |
#floor ⇒ Object
Returns the value of attribute floor.
29 30 31 |
# File 'lib/ups_pickup/address.rb', line 29 def floor @floor end |
#phone_number ⇒ Object
Returns the value of attribute phone_number.
29 30 31 |
# File 'lib/ups_pickup/address.rb', line 29 def phone_number @phone_number end |
#pickup_point ⇒ Object
Returns the value of attribute pickup_point.
29 30 31 |
# File 'lib/ups_pickup/address.rb', line 29 def pickup_point @pickup_point end |
#residential_indicator ⇒ Object
Returns the value of attribute residential_indicator.
29 30 31 |
# File 'lib/ups_pickup/address.rb', line 29 def residential_indicator @residential_indicator end |
#room ⇒ Object
Returns the value of attribute room.
29 30 31 |
# File 'lib/ups_pickup/address.rb', line 29 def room @room end |
Instance Method Details
#to_ups_hash ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/ups_pickup/address.rb', line 42 def to_ups_hash { "ns2:CompanyName"=>@company_name, "ns2:ContactName"=>@contact_name, "ns2:AddressLine"=>@address_line, "ns2:Floor"=>@floor, "ns2:Room"=>@room, "ns2:City"=>@city, "ns2:StateProvince"=>@state, "ns2:PostalCode"=>@postal_code, "ns2:CountryCode"=>@country_code, "ns2:ResidentialIndicator"=>@residential_indicator, "ns2:PickupPoint"=>@pickup_point, "ns2:Phone"=>{ "ns2:Number"=>@phone_number, "ns2:Extension"=>@extension } } end |