Skip to content

module Athena::Console::Output::Interface #

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

Athena::Console::Output Athena::Console::Output::Null Athena::Console::Style::Output

Methods#

abstract #decorated=(decorated : Bool) : Nil #

Sets if printed messages should be decorated.

View source

abstract #decorated? #

Returns true if printed messages should have their decorations applied. I.e. ACON::Formatter::OutputStyleInterface.

View source

abstract #formatter #

Returns the ACON::Formatter::Interface used by self.

View source

abstract #formatter=(formatter : ACON::Formatter::Interface) : Nil #

Sets the ACON::Formatter::Interface used by self.

View source

abstract #print(message : String | Enumerable(String), verbosity : ACON::Output::Verbosity = :normal, output_type : ACON::Output::Type = :normal) : Nil #

Outputs the provided message. The verbosity and/or output_type parameters can be used to control when and how the message is printed.

View source

abstract #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. The verbosity and/or output_type parameters can be used to control when and how the message is printed.

View source

abstract #verbosity #

Returns the minimum ACON::Output::Verbosity required for a message to be printed.

View source

abstract #verbosity=(verbosity : ACON::Output::Verbosity) : Nil #

Set the minimum ACON::Output::Verbosity required for a message to be printed.

View source