Class: C2eCore::Drops::OrderVatDrop
- Includes:
- Helpers::OrderConversions
- Defined in:
- /build/app/mailers/c2e_core/drops/order_vat_drop.rb
Instance Method Summary collapse
-
#base ⇒ Decimal
-
Base of current VAT record.
-
-
#initialize(vat_hash, order) ⇒ OrderVatDrop
constructor
A new instance of OrderVatDrop.
-
#percentage ⇒ Decimal
-
Percentage of current VAT record.
-
-
#total ⇒ Decimal
-
Total value of current VAT record.
-
-
#vat ⇒ Decimal
-
Vat of current VAT record.
-
Methods included from Helpers::OrderConversions
#converted_price, #format_price
Constructor Details
#initialize(vat_hash, order) ⇒ OrderVatDrop
Returns a new instance of OrderVatDrop.
8 9 10 11 12 |
# File '/build/app/mailers/c2e_core/drops/order_vat_drop.rb', line 8 def initialize(vat_hash, order) super() @order = order @vat_hash = vat_hash end |
Instance Method Details
#base ⇒ Decimal
Returns - Base of current VAT record. E.g.: 100.0.
20 21 22 |
# File '/build/app/mailers/c2e_core/drops/order_vat_drop.rb', line 20 def base converted_price @vat_hash[:base].to_d end |
#percentage ⇒ Decimal
Returns - Percentage of current VAT record. E.g.: 15.0.
15 16 17 |
# File '/build/app/mailers/c2e_core/drops/order_vat_drop.rb', line 15 def percentage @vat_hash[:vat_rate].to_d end |
#total ⇒ Decimal
Returns - Total value of current VAT record. E.g.: 115.0.
30 31 32 |
# File '/build/app/mailers/c2e_core/drops/order_vat_drop.rb', line 30 def total converted_price(base + vat) end |
#vat ⇒ Decimal
Returns - Vat of current VAT record. E.g.: 15.0.
25 26 27 |
# File '/build/app/mailers/c2e_core/drops/order_vat_drop.rb', line 25 def vat converted_price @vat_hash[:vat].to_d end |