Class: Zold::List

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

Overview

LIST command

Instance Method Summary collapse

Constructor Details

#initialize(wallets:, log: Log::Quiet.new) ⇒ List

Returns a new instance of List.



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

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

Instance Method Details

#run(_ = []) ⇒ Object



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

def run(_ = [])
  @wallets.all.each do |id|
    wallet = Wallet.new(File.join(@wallets.path, id))
    @log.info("#{id}: #{wallet.balance}")
  end
end