Class: Wallets::CallbackContext

Inherits:
Struct
  • Object
show all
Defined in:
lib/wallets/callback_context.rb

Overview

Immutable event payload passed to lifecycle callbacks. Keeping callback data in one object makes it easier to extend callback APIs without breaking existing handlers.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#amountObject

Returns the value of attribute amount

Returns:

  • (Object)

    the current value of amount



7
8
9
# File 'lib/wallets/callback_context.rb', line 7

def amount
  @amount
end

#categoryObject

Returns the value of attribute category

Returns:

  • (Object)

    the current value of category



7
8
9
# File 'lib/wallets/callback_context.rb', line 7

def category
  @category
end

#eventObject

Returns the value of attribute event

Returns:

  • (Object)

    the current value of event



7
8
9
# File 'lib/wallets/callback_context.rb', line 7

def event
  @event
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



7
8
9
# File 'lib/wallets/callback_context.rb', line 7

def 
  @metadata
end

#new_balanceObject

Returns the value of attribute new_balance

Returns:

  • (Object)

    the current value of new_balance



7
8
9
# File 'lib/wallets/callback_context.rb', line 7

def new_balance
  @new_balance
end

#previous_balanceObject

Returns the value of attribute previous_balance

Returns:

  • (Object)

    the current value of previous_balance



7
8
9
# File 'lib/wallets/callback_context.rb', line 7

def previous_balance
  @previous_balance
end

#thresholdObject

Returns the value of attribute threshold

Returns:

  • (Object)

    the current value of threshold



7
8
9
# File 'lib/wallets/callback_context.rb', line 7

def threshold
  @threshold
end

#transactionObject

Returns the value of attribute transaction

Returns:

  • (Object)

    the current value of transaction



7
8
9
# File 'lib/wallets/callback_context.rb', line 7

def transaction
  @transaction
end

#transferObject

Returns the value of attribute transfer

Returns:

  • (Object)

    the current value of transfer



7
8
9
# File 'lib/wallets/callback_context.rb', line 7

def transfer
  @transfer
end

#walletObject

Returns the value of attribute wallet

Returns:

  • (Object)

    the current value of wallet



7
8
9
# File 'lib/wallets/callback_context.rb', line 7

def wallet
  @wallet
end

Instance Method Details

#ownerObject



20
21
22
# File 'lib/wallets/callback_context.rb', line 20

def owner
  wallet&.owner
end

#to_hObject



24
25
26
# File 'lib/wallets/callback_context.rb', line 24

def to_h
  super.compact
end