Sha256: 722fa622590cbccbc57783d2718690ce00001f98d8b97b1a552cd1d1661ae378
Contents?: true
Size: 940 Bytes
Versions: 34
Compression:
Stored size: 940 Bytes
Contents
module Workarea module Pricing class CacheKey attr_reader :shippings attr_accessor :order delegate :pricing, :discounts, to: :@request def initialize(order, shippings, request) @order = order @shippings = shippings @request = request end def parts [ pricing_key, discount_key, order_key, shipping_service_key, tax_key ] end def to_s Digest::SHA1.hexdigest(parts.join('/')) end private def pricing_key pricing.map(&:cache_key).join end def discount_key discounts.map(&:cache_key).join end def order_key order.cache_key end def shipping_service_key shippings.map(&:cache_key).join end def tax_key Workarea::Tax::Category.all.map(&:cache_key).join end end end end
Version data entries
34 entries across 34 versions & 1 rubygems