Class: Workarea::Pricing::CacheKey
- Inherits:
-
Object
- Object
- Workarea::Pricing::CacheKey
- Defined in:
- app/models/workarea/pricing/cache_key.rb
Instance Attribute Summary collapse
-
#order ⇒ Object
Returns the value of attribute order.
-
#payment ⇒ Object
readonly
Returns the value of attribute payment.
-
#shippings ⇒ Object
readonly
Returns the value of attribute shippings.
Instance Method Summary collapse
-
#initialize(order, shippings, payment, request) ⇒ CacheKey
constructor
A new instance of CacheKey.
- #parts ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(order, shippings, payment, request) ⇒ CacheKey
Returns a new instance of CacheKey.
8 9 10 11 12 13 |
# File 'app/models/workarea/pricing/cache_key.rb', line 8 def initialize(order, shippings, payment, request) @order = order @shippings = shippings @payment = payment @request = request end |
Instance Attribute Details
#order ⇒ Object
Returns the value of attribute order.
5 6 7 |
# File 'app/models/workarea/pricing/cache_key.rb', line 5 def order @order end |
#payment ⇒ Object (readonly)
Returns the value of attribute payment.
4 5 6 |
# File 'app/models/workarea/pricing/cache_key.rb', line 4 def payment @payment end |
#shippings ⇒ Object (readonly)
Returns the value of attribute shippings.
4 5 6 |
# File 'app/models/workarea/pricing/cache_key.rb', line 4 def shippings @shippings end |
Instance Method Details
#parts ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'app/models/workarea/pricing/cache_key.rb', line 15 def parts [ pricing_key, discount_key, order_key, shipping_service_key, payment_key, tax_key ].compact end |
#to_s ⇒ Object
26 27 28 |
# File 'app/models/workarea/pricing/cache_key.rb', line 26 def to_s Digest::SHA1.hexdigest(parts.join('/')) end |