Sha256: 911908ead6181d93d8889d0ef328fa02b3a6d7edefa705c61fd349091e0c1271
Contents?: true
Size: 1.46 KB
Versions: 2
Compression:
Stored size: 1.46 KB
Contents
# frozen_string_literal: true module FriendlyShipping module Services class UpsFreight class ShipmentOptions < FriendlyShipping::ShipmentOptions # @param structure_options [Array<StructureOptions>] # @param structure_options_class [Class] # @param kwargs [Hash] # @option kwargs [Array<PackageOptions>] :package_options # @option kwargs [Class] :package_options_class def initialize( structure_options: Set.new, structure_options_class: RatesStructureOptions, **kwargs ) @structure_options = structure_options @structure_options_class = structure_options_class super(**kwargs) end # @param structure [#id] # @return [StructureOptions] def options_for_structure(structure) structure_options.detect do |structure_option| structure_option.structure_id == structure.id end || structure_options_class.new(structure_id: nil) end private # @return [Array<StructureOptions>] attr_reader :structure_options # @return [Class] attr_reader :structure_options_class # @return [Array<PackageOptions>] # @deprecated Use {#structure_options} instead. def package_options warn "[DEPRECATION] `package_options` is deprecated. Please use `structure_options` instead." @package_options end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
friendly_shipping-0.10.1 | lib/friendly_shipping/services/ups_freight/shipment_options.rb |
friendly_shipping-0.10.0 | lib/friendly_shipping/services/ups_freight/shipment_options.rb |