Class: C2eCore::Drops::OrderPaymentMethodDrop

Inherits:
BaseDrop
  • Object
show all
Includes:
Helpers::OrderConversions
Defined in:
/build/app/mailers/c2e_core/drops/order_payment_method_drop.rb

Instance Method Summary collapse

Methods included from Helpers::OrderConversions

#converted_price, #format_price

Constructor Details

#initialize(order_payment_method) ⇒ OrderPaymentMethodDrop

Returns a new instance of OrderPaymentMethodDrop.



8
9
10
11
12
# File '/build/app/mailers/c2e_core/drops/order_payment_method_drop.rb', line 8

def initialize(order_payment_method)
  super()
  @order_payment_method = order_payment_method
  @order = @order_payment_method.order
end

Instance Method Details

#formatted_priceString

Returns - The amount paid converted to the order’s currency and formatted. E.g.: "123,45 Kč".

Returns:

  • (String)
    • The amount paid converted to the order’s currency and formatted. E.g.: "123,45 Kč".



29
30
31
32
33
# File '/build/app/mailers/c2e_core/drops/order_payment_method_drop.rb', line 29

def formatted_price
  stored_value __method__ do
    format_price(price)
  end
end

#payment_methodPaymentMethodDrop

Returns - Payment method as a drop objects.

Returns:



15
16
17
18
19
# File '/build/app/mailers/c2e_core/drops/order_payment_method_drop.rb', line 15

def payment_method
  stored_value __method__ do
    PaymentMethodDrop.new(@order_payment_method.payment_method)
  end
end

#priceFloat

Returns - The amount paid converted to the order’s currency. E.g.: 123.45.

Returns:

  • (Float)
    • The amount paid converted to the order’s currency. E.g.: 123.45.



22
23
24
25
26
# File '/build/app/mailers/c2e_core/drops/order_payment_method_drop.rb', line 22

def price
  stored_value __method__ do
    converted_price(@order_payment_method.price)
  end
end