Exception: Climate::ExitException
- Inherits:
-
CommandError
- Object
- StandardError
- Error
- CommandError
- Climate::ExitException
- Defined in:
- lib/climate/errors.rb
Overview
Command instances can raise this error to exit
Instance Attribute Summary collapse
-
#exit_code ⇒ Object
(also: #exitstatus)
readonly
Returns the value of attribute exit_code.
Attributes inherited from CommandError
Instance Method Summary collapse
-
#has_message? ⇒ Boolean
Ruby will helpfully change a nil message to be the name of the exception class, so we have to have a special predicate method to tell us whether message was nil or not.
-
#initialize(msg, exit_code = 1) ⇒ ExitException
constructor
A new instance of ExitException.
Constructor Details
#initialize(msg, exit_code = 1) ⇒ ExitException
Returns a new instance of ExitException.
32 33 34 35 36 |
# File 'lib/climate/errors.rb', line 32 def initialize(msg, exit_code=1) @exit_code = exit_code @message = msg super(msg) end |
Instance Attribute Details
#exit_code ⇒ Object (readonly) Also known as: exitstatus
Returns the value of attribute exit_code.
28 29 30 |
# File 'lib/climate/errors.rb', line 28 def exit_code @exit_code end |
Instance Method Details
#has_message? ⇒ Boolean
Ruby will helpfully change a nil message to be the name of the exception class, so we have to have a special predicate method to tell us whether message was nil or not
41 |
# File 'lib/climate/errors.rb', line 41 def ; !!@message ; end |