class Perfume::Exit

Public: There’s often need to exit from the app in a testable and graceful manner. Simple call to Kernel#exit isn’t such. This simple wrapper around the Kernel method allows to say goodbye message via service logging as well as status code.

Public Instance Methods

call() click to toggle source
# File lib/perfume/exit.rb, line 18
def call
  log.error(@message)
  Kernel.exit(@code)
end
defaults() click to toggle source
# File lib/perfume/exit.rb, line 10
def defaults
  { message: "Exiting...", code: 1 }
end
log() click to toggle source
# File lib/perfume/exit.rb, line 14
def log
  @log ||= self.class.log
end