Class: C2eCore::Drops::OrderDiscountDrop
- Includes:
- Helpers::OrderConversions
- Defined in:
- /build/app/mailers/c2e_core/drops/order_discount_drop.rb
Instance Method Summary collapse
-
#description ⇒ String
-
Discount description.
-
-
#initialize(discount_hash, order) ⇒ OrderDiscountDrop
constructor
A new instance of OrderDiscountDrop.
-
#value ⇒ Float
-
Discount value converted into order’s currency.
-
Methods included from Helpers::OrderConversions
#converted_price, #format_price
Constructor Details
#initialize(discount_hash, order) ⇒ OrderDiscountDrop
Returns a new instance of OrderDiscountDrop.
8 9 10 11 12 |
# File '/build/app/mailers/c2e_core/drops/order_discount_drop.rb', line 8 def initialize(discount_hash, order) super() @discount_hash = discount_hash @order = order end |
Instance Method Details
#description ⇒ String
Returns - Discount description. E.g.: “Sleva 10% na každou druhou pizzu.”.
20 21 22 |
# File '/build/app/mailers/c2e_core/drops/order_discount_drop.rb', line 20 def description C2eCore::JsonLocalization.locale_for(@discount_hash["description"]["full"], @order.language).to_s end |
#value ⇒ Float
Returns - Discount value converted into order’s currency. E.g.: 19.90.
15 16 17 |
# File '/build/app/mailers/c2e_core/drops/order_discount_drop.rb', line 15 def value converted_price @discount_hash["discounted_value"] end |