Class: Spree::Stock::Splitter::Base
- Inherits:
-
Object
- Object
- Spree::Stock::Splitter::Base
- Defined in:
- app/models/spree/stock/splitter/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#next_splitter ⇒ Object
readonly
Returns the value of attribute next_splitter.
-
#stock_location ⇒ Object
readonly
Returns the value of attribute stock_location.
Instance Method Summary collapse
-
#initialize(stock_location_or_packer, next_splitter = nil) ⇒ Base
constructor
A new instance of Base.
- #split(packages) ⇒ Object
Constructor Details
#initialize(stock_location_or_packer, next_splitter = nil) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 14 15 16 17 |
# File 'app/models/spree/stock/splitter/base.rb', line 9 def initialize(stock_location_or_packer, next_splitter = nil) if stock_location_or_packer.is_a?(Spree::StockLocation) @stock_location = stock_location_or_packer else Spree::Deprecation.warn("Initializing Splitters with a Packer is DEPRECATED. Pass a StockLocation instead.") @stock_location = stock_location_or_packer.stock_location end @next_splitter = next_splitter end |
Instance Attribute Details
#next_splitter ⇒ Object (readonly)
Returns the value of attribute next_splitter.
7 8 9 |
# File 'app/models/spree/stock/splitter/base.rb', line 7 def next_splitter @next_splitter end |
#stock_location ⇒ Object (readonly)
Returns the value of attribute stock_location.
7 8 9 |
# File 'app/models/spree/stock/splitter/base.rb', line 7 def stock_location @stock_location end |
Instance Method Details
#split(packages) ⇒ Object
19 20 21 |
# File 'app/models/spree/stock/splitter/base.rb', line 19 def split(packages) return_next(packages) end |