Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/claide/ansi.rb

Direct Known Subclasses

CLAide::ANSI::StringEscaper

Instance Method Summary collapse

Instance Method Details

#ansiStringEscaper

Returns An object which provides convenience methods to wrap the receiver in ANSI sequences.

Examples:


"example".ansi.yellow #=> "\e[33mexample\e[39m"
"example".ansi.on_red #=> "\e[41mexample\e[49m"
"example".ansi.bold   #=> "\e[1mexample\e[21m"

Returns:

  • (StringEscaper)

    An object which provides convenience methods to wrap the receiver in ANSI sequences.



123
124
125
# File 'lib/claide/ansi.rb', line 123

def ansi
  CLAide::ANSI::StringEscaper.new(self)
end