class TTYString
Renders a string taking into ANSI escape codes and trn etc Usage: TTYString.parse
(“Thisre[KThat”) => “That”
Constants
- VERSION
Attributes
clear_style[R]
parser[R]
Public Class Methods
new(input_string, clear_style: true)
click to toggle source
# File lib/tty_string.rb, line 18 def initialize(input_string, clear_style: true) @parser = Parser.new(input_string) @parser.clear_style = clear_style end
parse(input_string, clear_style: true)
click to toggle source
# 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()
click to toggle source
# File lib/tty_string.rb, line 13 def to_proc method(:parse).to_proc end
Public Instance Methods
to_s()
click to toggle source
# File lib/tty_string.rb, line 23 def to_s parser.render end