Class: SplttyCLI::Commands::Settle

Inherits:
Dry::CLI::Command
  • Object
show all
Defined in:
lib/spltty_cli/commands/settle.rb

Overview

spltty settle [LEDGER...] — record settlement rows. One ledger: a ledger-local cash settlement (full, or partial via -v), never touching other ledgers. No/many ledgers: offset mode — ledgers whose debt points opposite to the combined direction are zeroed with mirrored offset rows (no real money); cash is written only when -v is given, allocated smallest-ledger-first against what remains.

Instance Method Summary collapse

Instance Method Details

#call(ledgers: [], **opts) ⇒ Object



36
37
38
39
40
41
# File 'lib/spltty_cli/commands/settle.rb', line 36

def call(ledgers: [], **opts)
  SettleRunner.new(ledgers, opts).run
rescue Prompt::Abort, Config::Error, ArgumentError => e
  warn "spltty settle: #{e.message}"
  exit 1
end