Class: Matheus::Command

Inherits:
Object
  • Object
show all
Extended by:
StringFormat
Includes:
Result::Methods
Defined in:
lib/matheus/command.rb

Direct Known Subclasses

AlertMe, ConvertCurrency, DateOfLast, Puts, Q, Qs, QuickCommit

Class Method Summary collapse

Methods included from StringFormat

bold, error, red

Methods included from Result::Methods

#Failure, #Success

Class Method Details

.callObject



8
9
10
11
12
13
# File 'lib/matheus/command.rb', line 8

def self.call(...)
  new
    .call(...)
    .then { Result.from(_1) } # ensure it's a Result object
    .on_failure { |error_msg| abort error(error_msg) }
end