Class: SplttyCLI::Commands::Add

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

Overview

spltty add — append one expense row to a ledger, applying payment-method defaults from config and offering to create the ledger/file if missing.

Instance Method Summary collapse

Instance Method Details

#call(**opts) ⇒ Object



38
39
40
41
42
43
# File 'lib/spltty_cli/commands/add.rb', line 38

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