Class: FriendlyShipping::Services::RL::RateQuoteOptions
- Inherits:
-
ShipmentOptions
- Object
- FriendlyShipping::ShipmentOptions
- ShipmentOptions
- FriendlyShipping::Services::RL::RateQuoteOptions
- Defined in:
- lib/friendly_shipping/services/rl/rate_quote_options.rb
Overview
Rate quote options for serializing R+L API requests.
Constant Summary collapse
- ADDITIONAL_SERVICE_CODES =
Optional service codes that can be used for R+L shipments.
%w[ InsideDelivery LimitedAccessPickup LimitedAccessDelivery OriginLiftgate DestinationLiftgate DeliveryAppointment Hazmat InsidePickup Freezable SortAndSegregate OverDimension ].freeze
Instance Attribute Summary collapse
-
#additional_service_codes ⇒ Array<String>
readonly
Additional service codes.
-
#declared_value ⇒ Numeric
readonly
The declared value of this shipment.
-
#packages_serializer ⇒ Callable
readonly
deprecated
Deprecated.
Use #structures_serializer instead.
-
#pickup_date ⇒ Time
readonly
The pickup date.
-
#structures_serializer ⇒ Callable
readonly
The serializer for this shipment's structures.
Instance Method Summary collapse
-
#initialize(pickup_date:, declared_value: nil, additional_service_codes: [], structures_serializer: RateQuoteStructuresSerializer, packages_serializer: RateQuotePackagesSerializer, **kwargs) ⇒ RateQuoteOptions
constructor
A new instance of RateQuoteOptions.
Methods inherited from ShipmentOptions
Methods inherited from FriendlyShipping::ShipmentOptions
Constructor Details
#initialize(pickup_date:, declared_value: nil, additional_service_codes: [], structures_serializer: RateQuoteStructuresSerializer, packages_serializer: RateQuotePackagesSerializer, **kwargs) ⇒ RateQuoteOptions
Returns a new instance of RateQuoteOptions.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/friendly_shipping/services/rl/rate_quote_options.rb', line 34 def initialize( pickup_date:, declared_value: nil, additional_service_codes: [], structures_serializer: RateQuoteStructuresSerializer, packages_serializer: RateQuotePackagesSerializer, **kwargs ) @pickup_date = pickup_date @declared_value = declared_value @additional_service_codes = additional_service_codes @structures_serializer = structures_serializer @packages_serializer = packages_serializer validate_additional_service_codes! super(**kwargs.reverse_merge(package_options_class: PackageOptions)) end |
Instance Attribute Details
#additional_service_codes ⇒ Array<String> (readonly)
Returns additional service codes.
15 16 17 |
# File 'lib/friendly_shipping/services/rl/rate_quote_options.rb', line 15 def additional_service_codes @additional_service_codes end |
#declared_value ⇒ Numeric (readonly)
Returns the declared value of this shipment.
12 13 14 |
# File 'lib/friendly_shipping/services/rl/rate_quote_options.rb', line 12 def declared_value @declared_value end |
#packages_serializer ⇒ Callable (readonly)
Deprecated.
Use #structures_serializer instead.
Returns the serializer for this shipment's packages.
22 23 24 |
# File 'lib/friendly_shipping/services/rl/rate_quote_options.rb', line 22 def packages_serializer @packages_serializer end |
#pickup_date ⇒ Time (readonly)
Returns the pickup date.
9 10 11 |
# File 'lib/friendly_shipping/services/rl/rate_quote_options.rb', line 9 def pickup_date @pickup_date end |
#structures_serializer ⇒ Callable (readonly)
Returns the serializer for this shipment's structures.
18 19 20 |
# File 'lib/friendly_shipping/services/rl/rate_quote_options.rb', line 18 def structures_serializer @structures_serializer end |