Skip to content

class Athena::Console::Formatter::Output
inherits Reference #

Default implementation of ACON::Formatter::WrappableInterface.

Included modules

Athena::Console::Formatter::WrappableInterface

Constructors#

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

Class methods#

.escape(text : String) : String#

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

.escape_trailing_backslash(text : String) : String#

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

Methods#

#decorated=(decorated : Bool)#

Sets if output messages should be decorated.

#decorated? : Bool#

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

#format(message : String | Nil) : String#

Formats the provided message according to the stored styles.

#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

#has_style?(name : String) : Bool#

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

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

Assigns the provided style to the provided name.

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

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