Exception: DocoptNG::Exit
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- DocoptNG::Exit
- Defined in:
- lib/docopt_ng/exceptions.rb
Class Attribute Summary collapse
-
.usage ⇒ Object
Returns the value of attribute usage.
Instance Attribute Summary collapse
-
#exit_code ⇒ Object
readonly
Returns the value of attribute exit_code.
Instance Method Summary collapse
-
#initialize(message = '', exit_code: nil) ⇒ Exit
constructor
A new instance of Exit.
Constructor Details
#initialize(message = '', exit_code: nil) ⇒ Exit
Returns a new instance of Exit.
16 17 18 19 |
# File 'lib/docopt_ng/exceptions.rb', line 16 def initialize( = '', exit_code: nil) @exit_code = exit_code || 1 super "#{}\n#{self.class.usage}".strip end |
Class Attribute Details
.usage ⇒ Object
Returns the value of attribute usage.
7 8 9 |
# File 'lib/docopt_ng/exceptions.rb', line 7 def usage @usage end |
Instance Attribute Details
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code.
14 15 16 |
# File 'lib/docopt_ng/exceptions.rb', line 14 def exit_code @exit_code end |