Class: Perfume::Exit
- Inherits:
-
Service
- Object
- SuperObject
- Service
- Perfume::Exit
- Defined in:
- lib/perfume/exit.rb
Overview
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.
Instance Method Summary collapse
Methods inherited from Service
Methods included from Gallus::Logging
Methods inherited from SuperObject
args, args_accessor, args_reader, args_writer, #init, init_args, #initialize
Constructor Details
This class inherits a constructor from Perfume::SuperObject
Instance Method Details
#call ⇒ Object
18 19 20 21 |
# File 'lib/perfume/exit.rb', line 18 def call log.error() Kernel.exit(@code) end |
#defaults ⇒ Object
10 11 12 |
# File 'lib/perfume/exit.rb', line 10 def defaults { message: "Exiting...", code: 1 } end |
#log ⇒ Object
14 15 16 |
# File 'lib/perfume/exit.rb', line 14 def log @log ||= self.class.log end |