Class: Spree::Stock::Splitter::Backordered Private

Inherits:
Base
  • Object
show all
Defined in:
app/models/spree/stock/splitter/backordered.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary

Attributes inherited from Base

#next_splitter, #packer

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Spree::Stock::Splitter::Base

Instance Method Details

#split(packages) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/models/spree/stock/splitter/backordered.rb', line 5

def split(packages)
  split_packages = []
  packages.each do |package|
    if package.on_hand.count > 0
      split_packages << build_package(package.on_hand)
    end

    if package.backordered.count > 0
      split_packages << build_package(package.backordered)
    end
  end
  return_next split_packages
end