Class: TTYString
- Inherits:
-
Object
- Object
- TTYString
- Defined in:
- lib/tty_string.rb,
lib/tty_string/code.rb,
lib/tty_string/cursor.rb,
lib/tty_string/parser.rb,
lib/tty_string/screen.rb,
lib/tty_string/version.rb,
lib/tty_string/csi_code.rb,
lib/tty_string/code_definitions.rb,
lib/tty_string/csi_code_definitions.rb
Overview
Renders a string taking into ANSI escape codes and trn etc Usage: TTYString.parse(“Thisre[KThat”) => “That”
Defined Under Namespace
Classes: CSICode, Code, Cursor, Parser, Screen
Constant Summary collapse
- VERSION =
'1.1.1'
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(input_string, clear_style: true) ⇒ TTYString
constructor
A new instance of TTYString.
- #to_s ⇒ Object
Constructor Details
Class Method Details
.parse(input_string, clear_style: true) ⇒ Object
9 10 11 |
# File 'lib/tty_string.rb', line 9 def parse(input_string, clear_style: true) new(input_string, clear_style: clear_style).to_s end |
.to_proc ⇒ Object
13 14 15 |
# File 'lib/tty_string.rb', line 13 def to_proc method(:parse).to_proc end |
Instance Method Details
#to_s ⇒ Object
23 24 25 |
# File 'lib/tty_string.rb', line 23 def to_s parser.render end |