Class: C2eCore::Drops::CreditsWalletDrop

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

Instance Method Summary collapse

Constructor Details

#initialize(wallet) ⇒ CreditsWalletDrop

Returns a new instance of CreditsWalletDrop.



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

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

Instance Method Details

#balanceFloat

Returns - Wallet credit balance. E.g.: 123.45.

Returns:

  • (Float)
    • Wallet credit balance. E.g.: 123.45.



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

def balance
  @wallet.balance
end

#groupCreditsGroupDrop

Returns - Returns credit group to which wallet belongs as drop object.

Returns:

  • (CreditsGroupDrop)
    • Returns credit group to which wallet belongs as drop object.



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

def group
  stored_value __method__ do
    CreditsGroupDrop.new(@wallet.group)
  end
end

#nfc_idString

Returns - The wallet’s NFC ID, e.g. "049C64D2452B80".

Returns:

  • (String)
    • The wallet’s NFC ID, e.g. "049C64D2452B80".



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

def nfc_id
  @wallet.nfc_id
end