Class: Zold::Propagate
- Inherits:
-
Object
- Object
- Zold::Propagate
- Defined in:
- lib/zold/commands/propagate.rb
Overview
PROPAGATE pulling command
Instance Method Summary collapse
-
#initialize(wallets:, log: Log::Quiet.new) ⇒ Propagate
constructor
A new instance of Propagate.
-
#run(args = []) ⇒ Object
Returns list of Wallet IDs which were affected.
Constructor Details
Instance Method Details
#run(args = []) ⇒ Object
Returns list of Wallet IDs which were affected
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/zold/commands/propagate.rb', line 45 def run(args = []) opts = Slop.parse(args, help: true, suppress_errors: true) do |o| o. = "Usage: zold propagate [ID...] [options] Available options:" o.bool '--help', 'Print instructions' end mine = Args.new(opts, @log).take || return modified = [] (mine.empty? ? @wallets.all : mine.map { |i| Id.new(i) }).each do |id| modified += propagate(id, opts) end modified end |