class TTYString::Parser

Reads the text string a

Attributes

clear_style[RW]
screen[R]

Public Instance Methods

cursor() click to toggle source
# File lib/tty_string/parser.rb, line 22
def cursor
  screen.cursor
end
render() click to toggle source
# File lib/tty_string/parser.rb, line 15
def render
  reset
  @screen = Screen.new
  read until eos?
  screen.to_s
end

Private Instance Methods

default() click to toggle source
# File lib/tty_string/parser.rb, line 36
def default
  write(getch)
end
read() click to toggle source
# File lib/tty_string/parser.rb, line 32
def read
  TTYString::Code.descendants.any? { |c| c.render(self) } || default
end
write(string) click to toggle source
# File lib/tty_string/parser.rb, line 28
def write(string)
  screen.write(string)
end