Class: Shipping::Pickup
- Inherits:
-
Object
- Object
- Shipping::Pickup
- Defined in:
- lib/ups_shipping/pickup.rb
Instance Attribute Summary collapse
-
#address_lines ⇒ Object
Returns the value of attribute address_lines.
-
#contact_method ⇒ Object
Returns the value of attribute contact_method.
-
#pickup_day ⇒ Object
Returns the value of attribute pickup_day.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #build_schedule(xml) ⇒ Object
- #build_type(xml) ⇒ Object
-
#initialize(options = {}) ⇒ Pickup
constructor
A new instance of Pickup.
Constructor Details
#initialize(options = {}) ⇒ Pickup
Returns a new instance of Pickup.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ups_shipping/pickup.rb', line 7 def initialize(={}) @type = [:type] if [:pickup_day] @pickup_day = [:pickup_day] end if [:contact_method] @contact_method = [:contact_method] end @pickupTypes = { "01" => "Daily Pickup", "03" => "Customer Counter", "06" => "One Time Pickup", "07" => "On Call Air", "19" => "Letter Center", "20" => "Air Service Center" } end |
Instance Attribute Details
#address_lines ⇒ Object
Returns the value of attribute address_lines.
5 6 7 |
# File 'lib/ups_shipping/pickup.rb', line 5 def address_lines @address_lines end |
#contact_method ⇒ Object
Returns the value of attribute contact_method.
5 6 7 |
# File 'lib/ups_shipping/pickup.rb', line 5 def contact_method @contact_method end |
#pickup_day ⇒ Object
Returns the value of attribute pickup_day.
5 6 7 |
# File 'lib/ups_shipping/pickup.rb', line 5 def pickup_day @pickup_day end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/ups_shipping/pickup.rb', line 5 def type @type end |
Instance Method Details
#build_schedule(xml) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/ups_shipping/pickup.rb', line 26 def build_schedule(xml) xml.OnCallAir { xml.Schedule { if @pickup_day xml.PickupDay @pickup_day end if @contact_method xml.Method @contact_method end } } end |
#build_type(xml) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/ups_shipping/pickup.rb', line 39 def build_type(xml) xml.PickupType { xml.Code type xml.Description @pickupTypes[type] } end |