Class: Zold::Create

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

Overview

Create command

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Create.



32
33
34
35
36
# File 'lib/zold/commands/create.rb', line 32

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

Instance Method Details

#runObject



38
39
40
41
42
43
44
# File 'lib/zold/commands/create.rb', line 38

def run
  id = Id.new
  wallet = @wallets.find(id)
  wallet.init(id, @pubkey)
  @log.info("#{wallet} created at #{@wallets}")
  wallet
end