Sha256: 2d9c06df14effd39a50b16e0dfc79994c7f58abf3ed14549f7b5e59aabf562c6

Contents?: true

Size: 303 Bytes

Versions: 133

Compression:

Stored size: 303 Bytes

Contents

# frozen_string_literal: true

module Spree
  module Stock
    class ShippingRateSelector
      attr_reader :shipping_rates

      def initialize(shipping_rates)
        @shipping_rates = shipping_rates
      end

      def find_default
        shipping_rates.min_by(&:cost)
      end
    end
  end
end

Version data entries

133 entries across 133 versions & 2 rubygems

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