Class: Spree::Stock::Differentiator Private

Inherits:
Object
  • Object
show all
Defined in:
app/models/spree/stock/differentiator.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Differentiator) initialize(order, packages)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Differentiator



6
7
8
9
10
11
12
# File 'app/models/spree/stock/differentiator.rb', line 6

def initialize(order, packages)
  @order = order
  @packages = packages
  build_packed
  build_required
  build_missing
end

Instance Attribute Details

- (Object) missing (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



4
5
6
# File 'app/models/spree/stock/differentiator.rb', line 4

def missing
  @missing
end

- (Object) order (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



4
5
6
# File 'app/models/spree/stock/differentiator.rb', line 4

def order
  @order
end

- (Object) packages (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



4
5
6
# File 'app/models/spree/stock/differentiator.rb', line 4

def packages
  @packages
end

- (Object) packed (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



4
5
6
# File 'app/models/spree/stock/differentiator.rb', line 4

def packed
  @packed
end

- (Object) required (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



4
5
6
# File 'app/models/spree/stock/differentiator.rb', line 4

def required
  @required
end

Instance Method Details

- (Boolean) missing?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


14
15
16
# File 'app/models/spree/stock/differentiator.rb', line 14

def missing?
  missing.values.any? { |v| v > 0 }
end