Class: FriendlyShipping::Services::ShipEngine::LabelOptions
- Inherits:
-
FriendlyShipping::ShipmentOptions
- Object
- FriendlyShipping::ShipmentOptions
- FriendlyShipping::Services::ShipEngine::LabelOptions
- Defined in:
- lib/friendly_shipping/services/ship_engine/label_options.rb
Overview
Options for generating shipping labels.
Instance Attribute Summary collapse
-
#customs_items_serializer ⇒ Proc, #call
readonly
A callable that takes packages and an options object to create the customs items array for the shipment.
-
#customs_options ⇒ LabelCustomsOptions
readonly
Customs options for international shipment labels.
-
#label_download_type ⇒ Symbol
readonly
Whether to download directly or obtain a URL to the label.
-
#label_format ⇒ Symbol
readonly
The format for the label.
-
#label_image_id ⇒ String
readonly
Identifier for image uploaded to ShipEngine.
-
#shipping_method ⇒ ShippingMethod
readonly
The label's shipping method.
Instance Method Summary collapse
-
#initialize(shipping_method:, label_download_type: :url, label_format: :pdf, label_image_id: nil, customs_options: LabelCustomsOptions.new, customs_items_serializer: CustomsItemsSerializer, **kwargs) ⇒ LabelOptions
constructor
A new instance of LabelOptions.
Methods inherited from FriendlyShipping::ShipmentOptions
Constructor Details
#initialize(shipping_method:, label_download_type: :url, label_format: :pdf, label_image_id: nil, customs_options: LabelCustomsOptions.new, customs_items_serializer: CustomsItemsSerializer, **kwargs) ⇒ LabelOptions
Returns a new instance of LabelOptions.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/friendly_shipping/services/ship_engine/label_options.rb', line 35 def initialize( shipping_method:, label_download_type: :url, label_format: :pdf, label_image_id: nil, customs_options: LabelCustomsOptions.new, customs_items_serializer: CustomsItemsSerializer, **kwargs ) @shipping_method = shipping_method @label_download_type = label_download_type @label_format = label_format @label_image_id = label_image_id = @customs_items_serializer = customs_items_serializer super(**kwargs.reverse_merge(package_options_class: LabelPackageOptions)) end |
Instance Attribute Details
#customs_items_serializer ⇒ Proc, #call (readonly)
24 25 26 |
# File 'lib/friendly_shipping/services/ship_engine/label_options.rb', line 24 def customs_items_serializer @customs_items_serializer end |
#customs_options ⇒ LabelCustomsOptions (readonly)
21 22 23 |
# File 'lib/friendly_shipping/services/ship_engine/label_options.rb', line 21 def end |
#label_download_type ⇒ Symbol (readonly)
12 13 14 |
# File 'lib/friendly_shipping/services/ship_engine/label_options.rb', line 12 def label_download_type @label_download_type end |
#label_format ⇒ Symbol (readonly)
15 16 17 |
# File 'lib/friendly_shipping/services/ship_engine/label_options.rb', line 15 def label_format @label_format end |
#label_image_id ⇒ String (readonly)
18 19 20 |
# File 'lib/friendly_shipping/services/ship_engine/label_options.rb', line 18 def label_image_id @label_image_id end |
#shipping_method ⇒ ShippingMethod (readonly)
9 10 11 |
# File 'lib/friendly_shipping/services/ship_engine/label_options.rb', line 9 def shipping_method @shipping_method end |