Class: Spree::Stock::LocationFilter::Base Abstract
- Inherits:
-
Object
- Object
- Spree::Stock::LocationFilter::Base
- Defined in:
- app/models/spree/stock/location_filter/base.rb
Overview
This class is abstract.
To implement your own location filter, subclass and implement #filter.
Stock location filters are used to which stock location should be considered when allocating stocks for a new shipment
Direct Known Subclasses
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#stock_locations ⇒ Object
readonly
Returns the value of attribute stock_locations.
Instance Method Summary collapse
-
#filter ⇒ Enumerable<Spree::StockLocation>
Filter the stock locations.
-
#initialize(stock_locations, order) ⇒ Base
constructor
Initializes the stock location filter.
Constructor Details
#initialize(stock_locations, order) ⇒ Base
Initializes the stock location filter.
28 29 30 31 |
# File 'app/models/spree/stock/location_filter/base.rb', line 28 def initialize(stock_locations, order) @stock_locations = stock_locations @order = order end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
20 21 22 |
# File 'app/models/spree/stock/location_filter/base.rb', line 20 def order @order end |
#stock_locations ⇒ Object (readonly)
Returns the value of attribute stock_locations.
15 16 17 |
# File 'app/models/spree/stock/location_filter/base.rb', line 15 def stock_locations @stock_locations end |
Instance Method Details
#filter ⇒ Enumerable<Spree::StockLocation>
Filter the stock locations.
37 38 39 |
# File 'app/models/spree/stock/location_filter/base.rb', line 37 def filter raise NotImplementedError end |