Class: C2eCore::Drops::CreditsRefundRequestDrop

Inherits:
BaseDrop
  • Object
show all
Includes:
ActionView::Helpers::NumberHelper
Defined in:
/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb

Instance Method Summary collapse

Constructor Details

#initialize(refund_request) ⇒ CreditsRefundRequestDrop

Returns a new instance of CreditsRefundRequestDrop.



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

def initialize(refund_request)
  super()
  @refund_request = refund_request
end

Instance Method Details

#account_holderString?

Returns - The name of the account holder used in the request.

Returns:

  • (String, nil)
    • The name of the account holder used in the request.



44
45
46
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 44

def 
  @refund_request.
end

#account_numberString

Returns - The account number used in the request. It can be in a national format for the Czech Republic (e.g. "19-2000145399/0800") or in an IBAN format (e.g. CZ6508000000192000145399).

Returns:

  • (String)
    • The account number used in the request. It can be in a national format for the Czech

    Republic (e.g. "19-2000145399/0800") or in an IBAN format (e.g. CZ6508000000192000145399).



39
40
41
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 39

def 
  @refund_request.
end

#amountFloat

Returns - The refund request amount, e.g. 123.45.

Returns:

  • (Float)
    • The refund request amount, e.g. 123.45.



14
15
16
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 14

def amount
  @refund_request.amount
end

#currencyCurrencyDrop

Returns - The currency of the request amount as a drop object.

Returns:

  • (CurrencyDrop)
    • The currency of the request amount as a drop object.



24
25
26
27
28
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 24

def currency
  stored_value __method__ do
    CurrencyDrop.new(@refund_request.currency)
  end
end

#formatted_amountString

Returns - The refund request amount formatted in its currency, e.g. "123,45 Kč".

Returns:

  • (String)
    • The refund request amount formatted in its currency, e.g. "123,45 Kč".



19
20
21
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 19

def formatted_amount
  number_to_currency(amount, unit: @refund_request.currency.to_s)
end

#requested_atDateTime

Returns - The date and time when the request was made.

Returns:

  • (DateTime)
    • The date and time when the request was made.



49
50
51
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 49

def requested_at
  @refund_request.requested_at
end

#unsubscribe_urlString

Returns - URL to the consents management app.

Returns:

  • (String)
    • URL to the consents management app.



54
55
56
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 54

def unsubscribe_url
  Rails.application.config.options[:customer_unsubscribe_url]
end

#walletCreditsWalletDrop

Returns - The request wallet as a drop object.

Returns:



31
32
33
34
35
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 31

def wallet
  stored_value __method__ do
    CreditsWalletDrop.new(@refund_request.wallet)
  end
end