Sha256: cedc6e73928deef2f4de9ecd02d7d90d7ec0ed8bfa9397ed5945b564f74cb9c8

Contents?: true

Size: 563 Bytes

Versions: 48

Compression:

Stored size: 563 Bytes

Contents

# Used by Prioritizer to adjust item quantities
# see prioritizer_spec for use cases
module Spree
  module Stock
    class Adjuster
      attr_accessor :inventory_unit, :status, :fulfilled

      def initialize(inventory_unit, status)
        @inventory_unit = inventory_unit
        @status = status
        @fulfilled = false
      end

      def adjust(package)
        if fulfilled?
          package.remove(inventory_unit)
        else
          self.fulfilled = true
        end
      end

      def fulfilled?
        fulfilled
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
spree_core-3.1.14 app/models/spree/stock/adjuster.rb
spree_core-3.1.13 app/models/spree/stock/adjuster.rb
spree_core-3.1.12 app/models/spree/stock/adjuster.rb
spree_core-3.1.11 app/models/spree/stock/adjuster.rb
spree_core-3.1.10 app/models/spree/stock/adjuster.rb
spree_core-3.1.9 app/models/spree/stock/adjuster.rb
spree_core-3.1.8 app/models/spree/stock/adjuster.rb
spree_core-3.1.7 app/models/spree/stock/adjuster.rb
spree_core-3.1.6 app/models/spree/stock/adjuster.rb
spree_core-3.1.5 app/models/spree/stock/adjuster.rb
spree_core-3.1.4 app/models/spree/stock/adjuster.rb
spree_core-3.1.3 app/models/spree/stock/adjuster.rb
spree_core-3.1.2 app/models/spree/stock/adjuster.rb
spree_core-3.0.10 app/models/spree/stock/adjuster.rb
spree_core-3.1.1 app/models/spree/stock/adjuster.rb
spree_core-3.1.0 app/models/spree/stock/adjuster.rb
spree_core-3.1.0.rc4 app/models/spree/stock/adjuster.rb
spree_core-3.0.9 app/models/spree/stock/adjuster.rb
spree_core-3.1.0.rc3 app/models/spree/stock/adjuster.rb
spree_core-3.1.0.rc2 app/models/spree/stock/adjuster.rb