Class: Zold::Balance

Inherits:
Object
  • Object
show all
Defined in:
lib/zold/commands/balance.rb

Overview

Balance checking command

Instance Method Summary collapse

Constructor Details

#initialize(wallet:, log: Log::Quiet.new) ⇒ Balance

Returns a new instance of Balance.



30
31
32
33
# File 'lib/zold/commands/balance.rb', line 30

def initialize(wallet:, log: Log::Quiet.new)
  @wallet = wallet
  @log = log
end

Instance Method Details

#runObject



35
36
37
38
39
# File 'lib/zold/commands/balance.rb', line 35

def run
  balance = @wallet.balance
  @log.info("The balance of #{@wallet} is #{balance}")
  balance
end