module Athena::Console::Output::Interface
Overview
Athena::Console
uses a dedicated interface for representing an output destination.
This allows it to have multiple more specialized implementations as opposed to
being tightly coupled to STDOUT
or a raw IO.
This interface represents the methods that must be implemented, however implementations can add additional functionality.
The most common implementations include ACON::Output::ConsoleOutput
which is based on STDOUT
and STDERR
,
and ACON::Output::Null
which can be used when you want to silent all output, such as for tests.
Each output's ACON::Output::Verbosity
and output ACON::Output::Type
can also be configured on a per message basis.
Direct including types
Defined in:
output/interface.crInstance Method Summary
-
#decorated=(decorated : Bool) : Nil
Sets if printed messages should be decorated.
-
#decorated? : Bool
Returns
true
if printed messages should have their decorations applied. -
#formatter : ACON::Formatter::Interface
Returns the
ACON::Formatter::Interface
used byself
. -
#formatter=(formatter : ACON::Formatter::Interface) : Nil
Sets the
ACON::Formatter::Interface
used byself
. -
#print(message : String | Enumerable(String), verbosity : ACON::Output::Verbosity = :normal, output_type : ACON::Output::Type = :normal) : Nil
Outputs the provided message.
-
#puts(message : String | Enumerable(String), verbosity : ACON::Output::Verbosity = :normal, output_type : ACON::Output::Type = :normal) : Nil
Outputs the provided message followed by a new line.
-
#verbosity : ACON::Output::Verbosity
Returns the minimum
ACON::Output::Verbosity
required for a message to be printed. -
#verbosity=(verbosity : ACON::Output::Verbosity) : Nil
Set the minimum
ACON::Output::Verbosity
required for a message to be printed.
Instance Method Detail
Returns true
if printed messages should have their decorations applied.
I.e. ACON::Formatter::OutputStyleInterface
.
Returns the ACON::Formatter::Interface
used by self
.
Sets the ACON::Formatter::Interface
used by self
.
Outputs the provided message. The verbosity and/or output_type parameters can be used to control when and how the message is printed.
Outputs the provided message followed by a new line. The verbosity and/or output_type parameters can be used to control when and how the message is printed.
Returns the minimum ACON::Output::Verbosity
required for a message to be printed.
Set the minimum ACON::Output::Verbosity
required for a message to be printed.