Class: C2eCore::Drops::CreditsExpiringSoonDrop

Inherits:
BaseDrop
  • Object
show all
Defined in:
/build/app/mailers/c2e_core/drops/credits_expiring_soon_drop.rb

Instance Method Summary collapse

Constructor Details

#initialize(wallet_activity) ⇒ CreditsExpiringSoonDrop

Returns a new instance of CreditsExpiringSoonDrop.



6
7
8
9
# File '/build/app/mailers/c2e_core/drops/credits_expiring_soon_drop.rb', line 6

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

Instance Method Details

#cash_payment_decimalsInteger

Returns - The number of decimal places the ‘remaining_amount` should be rounded to.

Returns:

  • (Integer)
    • The number of decimal places the ‘remaining_amount` should be rounded to.



27
28
29
# File '/build/app/mailers/c2e_core/drops/credits_expiring_soon_drop.rb', line 27

def cash_payment_decimals
  @wallet_activity.cash_payment_decimals
end

#expires_atDateTime

Returns - Datetime object containing the expiration time, e.g.: “2020-11-16T23:59:59+01:00”.

Returns:

  • (DateTime)
    • Datetime object containing the expiration time, e.g.: “2020-11-16T23:59:59+01:00”.



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

def expires_at
  @wallet_activity.expires_at
end

#formatted_remaining_amountString

Returns - Formatted value of ‘remaining_amount`.

Returns:

  • (String)
    • Formatted value of ‘remaining_amount`.



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

def formatted_remaining_amount
  @wallet_activity.formatted_remaining_amount
end

#remaining_amountFloat

Returns - Amount that will expire.

Returns:

  • (Float)
    • Amount that will expire.



12
13
14
# File '/build/app/mailers/c2e_core/drops/credits_expiring_soon_drop.rb', line 12

def remaining_amount
  @wallet_activity.remaining_amount
end