Sha256: 733c149800744127970093802c49e7cbe046047e09e82e748900946d59f1f5df

Contents?: true

Size: 1.14 KB

Versions: 18

Compression:

Stored size: 1.14 KB

Contents

# frozen_string_literal: true

require 'friendly_shipping/shipment_options'

module FriendlyShipping
  module Services
    class ShipEngine
      # Options for generating ShipEngine labels
      #
      # @attribute label_format [Symbol] The format for the label. Possible Values: :png, :zpl and :pdf. Default :pdf
      # @attribute label_download_type [Symbol] Whether to download directly (`:inline`) or
      #   obtain a URL to the label (`:url`). Default :url
      # @attribute package_options [Enumberable<LabelPackageOptions>] Package options for the packages in the shipment
      #
      class LabelOptions < FriendlyShipping::ShipmentOptions
        attr_reader :shipping_method,
                    :label_format,
                    :label_download_type

        def initialize(
          shipping_method:,
          label_format: :pdf,
          label_download_type: :url,
          **kwargs
        )
          @shipping_method = shipping_method
          @label_format = label_format
          @label_download_type = label_download_type
          super(**kwargs.merge(package_options_class: LabelPackageOptions))
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
friendly_shipping-0.7.1 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.7.0 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.6.5 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.6.4 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.6.3 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.6.2 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.6.1 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.6.0 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.5.3 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.5.2 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.5.1 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.5 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.4.14 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.4.13 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.4.12 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.4.11 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.4.10 lib/friendly_shipping/services/ship_engine/label_options.rb
friendly_shipping-0.4.9 lib/friendly_shipping/services/ship_engine/label_options.rb