Sha256: 8fa99c4222d7b3e3440270024024f3138b7dfe3ad74ab172f44086a9bc45acb5

Contents?: true

Size: 388 Bytes

Versions: 85

Compression:

Stored size: 388 Bytes

Contents

# frozen_string_literal: true

module Spree
  class ShippingCalculator < Calculator
    def compute_package(_package)
      raise NotImplementedError, "Please implement 'compute_package(package)' in your calculator: #{self.class.name}"
    end

    def available?(_package)
      true
    end

    private

    def total(content_items)
      content_items.sum(&:amount)
    end
  end
end

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
solidus_core-4.4.2 app/models/spree/shipping_calculator.rb
solidus_core-4.4.1 app/models/spree/shipping_calculator.rb
solidus_core-4.4.0 app/models/spree/shipping_calculator.rb
solidus_core-4.3.4 app/models/spree/shipping_calculator.rb
solidus_core-4.2.4 app/models/spree/shipping_calculator.rb
solidus_core-4.1.5 app/models/spree/shipping_calculator.rb
solidus_core-4.3.3 app/models/spree/shipping_calculator.rb
solidus_core-4.3.2 app/models/spree/shipping_calculator.rb
solidus_core-4.1.4 app/models/spree/shipping_calculator.rb
solidus_core-4.3.1 app/models/spree/shipping_calculator.rb
solidus_core-4.3.0 app/models/spree/shipping_calculator.rb
solidus_core-4.2.3 app/models/spree/shipping_calculator.rb
solidus_core-4.1.3 app/models/spree/shipping_calculator.rb
solidus_core-4.0.4 app/models/spree/shipping_calculator.rb
solidus_core-3.4.6 app/models/spree/shipping_calculator.rb
solidus_core-4.0.3 app/models/spree/shipping_calculator.rb
solidus_core-4.1.2 app/models/spree/shipping_calculator.rb
solidus_core-4.2.2 app/models/spree/shipping_calculator.rb
solidus_core-3.4.5 app/models/spree/shipping_calculator.rb
solidus_core-4.2.1 app/models/spree/shipping_calculator.rb