Class: SolidusAfterpay::ShippingRatePresenter
- Inherits:
-
Object
- Object
- SolidusAfterpay::ShippingRatePresenter
- Defined in:
- app/presentes/solidus_afterpay/shipping_rate_presenter.rb
Instance Method Summary collapse
- #amount_with_taxes ⇒ Object
-
#initialize(shipping_rate:) ⇒ ShippingRatePresenter
constructor
A new instance of ShippingRatePresenter.
- #order_amount ⇒ Object
Constructor Details
#initialize(shipping_rate:) ⇒ ShippingRatePresenter
Returns a new instance of ShippingRatePresenter.
5 6 7 |
# File 'app/presentes/solidus_afterpay/shipping_rate_presenter.rb', line 5 def initialize(shipping_rate:) @shipping_rate = shipping_rate end |
Instance Method Details
#amount_with_taxes ⇒ Object
16 17 18 |
# File 'app/presentes/solidus_afterpay/shipping_rate_presenter.rb', line 16 def amount_with_taxes shipping_rate.cost.to_f + shipping_rate.taxes.sum(&:amount) end |
#order_amount ⇒ Object
9 10 11 12 13 14 |
# File 'app/presentes/solidus_afterpay/shipping_rate_presenter.rb', line 9 def order_amount shipping_rate.order.item_total.to_f + shipping_rate.cost + shipping_rate.taxes.sum(&:amount) + order_presenter.line_items_tax_amount end |