You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: coordinator.rb
    path of file: ./repos/spree/core/app/models/spree/stock
    
    the code of the file until where you have to start completion: module Spree
  module Stock
    class Coordinator
      attr_reader   :order, :inventory_units
      attr_accessor :unallocated_inventory_units

      def initialize(order, inventory_units = nil)
        @order = ord
    
      def build_packages(packages = [])
        stock_locations_with_requested_variants.each do |stock_location|
          packer = build_packer(stock_location, inventory_units)
          packages += packer.packages
        end

        packages
      end