TerminalClass
- Namespace
- Ancestors
-
Object
Outputs help requests to a pair of IO objects, defaulting to $stdout
and
$stderr
. An instance of this class is used by default for outputting help
requests from Root, but can be overridden by invoking Root.help with
another object (such as an instance of this class that’s been constructed
with different parameters).
Constructor
initialize(output#puts = $stdout
, error#puts = $stderr
, exit_on_errorBoolean = true
)#⚙
Sets up help requests to be made to output (#dispatch, #method, and #version) and error (#error), as well as specifying whether to exit_on_error or not, see #error.
Instance Methods
dispatch(methodMethod, klassClass)self#⚙
Outputs a help request for a Class.dispatch method to klass, displaying all options and arguments to the method and listing the possible dispatch methods.
method(methodMethod)self#⚙
Outputs a help request for method, displaying all its options and arguments.
version(methodMethod, versionString)self#⚙
Outputs version information for method.
error(method, error)#⚙
Outputs error that occurred while processing method.
- Raises
-
- SystemExit
-
If exit_on_error was given as true to the receiver’s constructor
- error
-
If exit_on_error wasn’t given as true to the receiver’s constructor