class

Athena::Console::Formatter::Output

Inherits Athena::Console::Formatter::WrappableInterface / Athena::Console::Formatter::Interface / Reference / Object

Default implementation of ACON::Formatter::WrappableInterface.

Constructors

new(decorated : Bool = false, styles : Colorize::Mode | Nil = nil)
Source

Class methods

escape(text : String) : String

Returns a new string where the special < characters in the provided text are escaped.

Source
escape_trailing_backslash(text : String) : String

Returns a new string where trailing \ in the provided text is escaped.

Source

Instance methods

decorated=(decorated : Bool)

Sets if output messages should be decorated.

Source
decorated?

Returns true if output messages will be decorated, otherwise false.

Source
format(message : String | Nil) : String

Formats the provided message according to the stored styles.

Source
format_and_wrap(message : String | Nil, width : Int32) : String

Formats the provided message according to the defined styles, wrapping it at the provided width. A width of 0 means no wrapping. ameba:disable Metrics/CyclomaticComplexity

Source
has_style?(name : String) : Bool

Returns true if self has a style with the provided name, otherwise false.

Source
set_style(name : String, style : ACON::Formatter::OutputStyleInterface) : Nil

Assigns the provided style to the provided name.

Source
style(name : String) : ACON::Formatter::OutputStyleInterface

Returns an ACON::Formatter::OutputStyleInterface with the provided name.

Source