Sha256: ee513fa81c88db2f8b312ffc61a450dc83cbaf4a96eb0dfe0e0469415d5c9532

Contents?: true

Size: 666 Bytes

Versions: 52

Compression:

Stored size: 666 Bytes

Contents

module Spree
  module V2
    module Storefront
      class EstimatedShippingRateSerializer < BaseSerializer
        set_type :shipping_rate

        attributes :name, :selected, :cost, :tax_amount, :shipping_method_id

        attribute :final_price, &:cost

        attributes :display_cost, :display_final_price do |object, params|
          Spree::Money.new(object.cost, currency: params[:currency])
        end

        attribute :display_tax_amount do |object, params|
          Spree::Money.new(object.tax_amount, currency: params[:currency])
        end

        attribute :free do |object|
          object.cost.zero?
        end
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
spree_api-4.0.9 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-4.1.15 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-4.1.14 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-4.0.8 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-3.7.14.1 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-4.1.13.1 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-4.0.7.1 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-4.0.7 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-3.7.14 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-4.1.13 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-4.0.6 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-4.2.0.rc2 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-3.7.13 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-4.0.5 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-4.1.12 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-3.7.12 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-4.2.0.rc1 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-4.0.4 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-3.7.11 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
spree_api-4.1.11 app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb