Class: Spree::Stock::Splitter::CorreiosWeight
- Inherits:
-
Base
- Object
- Base
- Spree::Stock::Splitter::CorreiosWeight
- Defined in:
- app/models/spree/stock/splitter/correios_weight.rb
Instance Attribute Summary collapse
-
#next_splitter ⇒ Object
readonly
Returns the value of attribute next_splitter.
-
#packer ⇒ Object
readonly
Returns the value of attribute packer.
Instance Method Summary collapse
Instance Attribute Details
#next_splitter ⇒ Object (readonly)
Returns the value of attribute next_splitter.
5 6 7 |
# File 'app/models/spree/stock/splitter/correios_weight.rb', line 5 def next_splitter @next_splitter end |
#packer ⇒ Object (readonly)
Returns the value of attribute packer.
5 6 7 |
# File 'app/models/spree/stock/splitter/correios_weight.rb', line 5 def packer @packer end |
Instance Method Details
#split(packages) ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/models/spree/stock/splitter/correios_weight.rb', line 11 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 |