Class: Spree::Stock::LocationFilter::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
core/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

Active

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stock_locations, order) ⇒ Base

Initializes the stock location filter.

Parameters:



28
29
30
31
# File 'core/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

#orderObject (readonly)

Returns the value of attribute order



20
21
22
# File 'core/app/models/spree/stock/location_filter/base.rb', line 20

def order
  @order
end

#stock_locationsObject (readonly)

Returns the value of attribute stock_locations



15
16
17
# File 'core/app/models/spree/stock/location_filter/base.rb', line 15

def stock_locations
  @stock_locations
end

Instance Method Details

#filterEnumerable<Spree::StockLocation>

Filter the stock locations.

Returns:

Raises:

  • (NotImplementedError)


37
38
39
# File 'core/app/models/spree/stock/location_filter/base.rb', line 37

def filter
  raise NotImplementedError
end