Class: FriendlyShipping::Services::TForceFreight::PickupOptions
- Inherits:
-
FriendlyShipping::ShipmentOptions
- Object
- FriendlyShipping::ShipmentOptions
- FriendlyShipping::Services::TForceFreight::PickupOptions
- Defined in:
- lib/friendly_shipping/services/tforce_freight/pickup_options.rb
Overview
Options for creating a pickup.
Constant Summary collapse
- SERVICE_OPTIONS =
Maps friendly names to service options.
{ inside: "INPU", liftgate: "LIFO", freezable: "PFFF", residential: "RESP", extreme_length: "EXLT", trade_show: "TRPU" }.freeze
Instance Attribute Summary collapse
-
#delivery_instructions ⇒ String
readonly
Instructions for delivery.
-
#handling_instructions ⇒ String
readonly
Instructions for handling.
-
#pickup_at ⇒ Time
readonly
Date/time of pickup.
-
#pickup_instructions ⇒ String
readonly
Instructions for pickup.
-
#pickup_time_window ⇒ Range
readonly
Time window for pickup.
-
#service_options ⇒ Array<String>
readonly
Shipment pickup service options (see SERVICE_OPTIONS).
Instance Method Summary collapse
-
#initialize(pickup_at: Time.now, pickup_time_window: Time.now.beginning_of_day..Time.now.end_of_day, service_options: [], pickup_instructions: nil, handling_instructions: nil, delivery_instructions: nil, **kwargs) ⇒ PickupOptions
constructor
A new instance of PickupOptions.
Methods inherited from FriendlyShipping::ShipmentOptions
Constructor Details
#initialize(pickup_at: Time.now, pickup_time_window: Time.now.beginning_of_day..Time.now.end_of_day, service_options: [], pickup_instructions: nil, handling_instructions: nil, delivery_instructions: nil, **kwargs) ⇒ PickupOptions
Returns a new instance of PickupOptions.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/friendly_shipping/services/tforce_freight/pickup_options.rb', line 45 def initialize( pickup_at: Time.now, pickup_time_window: Time.now.beginning_of_day..Time.now.end_of_day, service_options: [], pickup_instructions: nil, handling_instructions: nil, delivery_instructions: nil, **kwargs ) @pickup_at = pickup_at @pickup_time_window = pickup_time_window @service_options = @pickup_instructions = pickup_instructions @handling_instructions = handling_instructions @delivery_instructions = delivery_instructions super(**kwargs.reverse_merge(package_options_class: PackageOptions)) end |
Instance Attribute Details
#delivery_instructions ⇒ String (readonly)
Returns instructions for delivery.
34 35 36 |
# File 'lib/friendly_shipping/services/tforce_freight/pickup_options.rb', line 34 def delivery_instructions @delivery_instructions end |
#handling_instructions ⇒ String (readonly)
Returns instructions for handling.
31 32 33 |
# File 'lib/friendly_shipping/services/tforce_freight/pickup_options.rb', line 31 def handling_instructions @handling_instructions end |
#pickup_at ⇒ Time (readonly)
Returns date/time of pickup.
19 20 21 |
# File 'lib/friendly_shipping/services/tforce_freight/pickup_options.rb', line 19 def pickup_at @pickup_at end |
#pickup_instructions ⇒ String (readonly)
Returns instructions for pickup.
28 29 30 |
# File 'lib/friendly_shipping/services/tforce_freight/pickup_options.rb', line 28 def pickup_instructions @pickup_instructions end |
#pickup_time_window ⇒ Range (readonly)
Returns time window for pickup.
22 23 24 |
# File 'lib/friendly_shipping/services/tforce_freight/pickup_options.rb', line 22 def pickup_time_window @pickup_time_window end |
#service_options ⇒ Array<String> (readonly)
Returns shipment pickup service options (see SERVICE_OPTIONS).
25 26 27 |
# File 'lib/friendly_shipping/services/tforce_freight/pickup_options.rb', line 25 def @service_options end |