Class: C2eCore::Drops::FinancialReportPaymentTypeDrop
- Inherits:
-
BaseDrop
- Object
- Liquid::Drop
- BaseDrop
- C2eCore::Drops::FinancialReportPaymentTypeDrop
- Includes:
- Helpers::FinancialReportConversions
- Defined in:
- /build/app/mailers/c2e_core/drops/financial_report_payment_type_drop.rb
Instance Method Summary collapse
-
#formatted_value ⇒ String
-
Total amount for this payment type converted to financial report’s currency and formatted.
-
-
#initialize(financial_report, payment_type, value, orders_count) ⇒ FinancialReportPaymentTypeDrop
constructor
A new instance of FinancialReportPaymentTypeDrop.
-
#orders_count ⇒ Integer
-
Number of orders that have been paid by the current payment type.
-
-
#payment_type ⇒ PaymentTypeDrop?
-
Payment type as drop object, if it is present.
-
-
#value ⇒ Float
-
Total amount for this payment type converted to financial report’s currency.
-
Methods included from Helpers::FinancialReportConversions
#converted_price, #format_price
Constructor Details
#initialize(financial_report, payment_type, value, orders_count) ⇒ FinancialReportPaymentTypeDrop
Returns a new instance of FinancialReportPaymentTypeDrop.
8 9 10 11 12 13 14 |
# File '/build/app/mailers/c2e_core/drops/financial_report_payment_type_drop.rb', line 8 def initialize(financial_report, payment_type, value, orders_count) super() @financial_report = financial_report @payment_type = payment_type @value = value @orders_count = orders_count end |
Instance Method Details
#formatted_value ⇒ String
Returns - Total amount for this payment type converted to financial report’s currency and formatted. E.g.: "123,45 Kč"
.
32 33 34 |
# File '/build/app/mailers/c2e_core/drops/financial_report_payment_type_drop.rb', line 32 def formatted_value format_price @value end |
#orders_count ⇒ Integer
Returns - Number of orders that have been paid by the current payment type. E.g.: 42.
37 38 39 |
# File '/build/app/mailers/c2e_core/drops/financial_report_payment_type_drop.rb', line 37 def orders_count @orders_count end |
#payment_type ⇒ PaymentTypeDrop?
Returns - Payment type as drop object, if it is present.
17 18 19 20 21 22 23 |
# File '/build/app/mailers/c2e_core/drops/financial_report_payment_type_drop.rb', line 17 def payment_type stored_value __method__ do next if @payment_type.nil? PaymentTypeDrop.new @payment_type end end |
#value ⇒ Float
Returns - Total amount for this payment type converted to financial report’s currency. E.g.: 78.
26 27 28 |
# File '/build/app/mailers/c2e_core/drops/financial_report_payment_type_drop.rb', line 26 def value @value end |