Class: Spree::Stock::Splitter::Weight

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

Instance Attribute Summary

Attributes inherited from Base

#next_splitter, #stock_location

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



9
10
11
12
13
14
15
# File 'app/models/spree/stock/splitter/weight.rb', line 9

def split(packages)
  packages.each do |package|
    removed_contents = reduce package
    packages << build_package(removed_contents) unless removed_contents.empty?
  end
  return_next packages
end