Class: FriendlyShipping::Services::ShipEngineLTL::ShipmentOptions
- Inherits:
-
FriendlyShipping::ShipmentOptions
- Object
- FriendlyShipping::ShipmentOptions
- FriendlyShipping::Services::ShipEngineLTL::ShipmentOptions
- Defined in:
- lib/friendly_shipping/services/ship_engine_ltl/shipment_options.rb
Instance Method Summary collapse
-
#initialize(structure_options: Set.new, structure_options_class: StructureOptions, **kwargs) ⇒ ShipmentOptions
constructor
A new instance of ShipmentOptions.
- #options_for_structure(structure) ⇒ StructureOptions
Methods inherited from FriendlyShipping::ShipmentOptions
Constructor Details
#initialize(structure_options: Set.new, structure_options_class: StructureOptions, **kwargs) ⇒ ShipmentOptions
Returns a new instance of ShipmentOptions.
12 13 14 15 16 17 18 19 20 |
# File 'lib/friendly_shipping/services/ship_engine_ltl/shipment_options.rb', line 12 def initialize( structure_options: Set.new, structure_options_class: StructureOptions, **kwargs ) @structure_options = @structure_options_class = super(**kwargs.reverse_merge(package_options_class: PackageOptions)) end |
Instance Method Details
#options_for_structure(structure) ⇒ StructureOptions
24 25 26 27 28 |
# File 'lib/friendly_shipping/services/ship_engine_ltl/shipment_options.rb', line 24 def (structure) .detect do |structure_option| structure_option.structure_id == structure.id end || .new(structure_id: nil) end |