Class: FriendlyShipping::StructureOptions
- Inherits:
-
Object
- Object
- FriendlyShipping::StructureOptions
- Defined in:
- lib/friendly_shipping/structure_options.rb
Overview
Options for structures (pallets, skids, etc) in a shipment.
Direct Known Subclasses
FriendlyShipping::Services::RL::StructureOptions, FriendlyShipping::Services::ShipEngineLTL::StructureOptions, FriendlyShipping::Services::TForceFreight::StructureOptions, FriendlyShipping::Services::UpsFreight::RatesStructureOptions
Instance Attribute Summary collapse
-
#structure_id ⇒ Object
readonly
Unique identifier for this set of options.
Instance Method Summary collapse
-
#initialize(structure_id:, package_options: [], package_options_class: PackageOptions) ⇒ StructureOptions
constructor
A new instance of StructureOptions.
- #options_for_package(package) ⇒ PackageOptions
Constructor Details
#initialize(structure_id:, package_options: [], package_options_class: PackageOptions) ⇒ StructureOptions
Returns a new instance of StructureOptions.
12 13 14 15 16 17 18 19 20 |
# File 'lib/friendly_shipping/structure_options.rb', line 12 def initialize( structure_id:, package_options: [], package_options_class: PackageOptions ) @structure_id = structure_id @package_options = @package_options_class = end |
Instance Attribute Details
#structure_id ⇒ Object (readonly)
Returns unique identifier for this set of options.
7 8 9 |
# File 'lib/friendly_shipping/structure_options.rb', line 7 def structure_id @structure_id end |
Instance Method Details
#options_for_package(package) ⇒ PackageOptions
24 25 26 27 28 |
# File 'lib/friendly_shipping/structure_options.rb', line 24 def (package) .detect do |package_option| package_option.package_id == package.id end || .new(package_id: nil) end |