Class: TP::Renderer

Inherits:
Object
  • Object
show all
Defined in:
lib/tp/renderer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Renderer

Returns a new instance of Renderer.



5
6
7
# File 'lib/tp/renderer.rb', line 5

def initialize(text)
  @text = text
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



3
4
5
# File 'lib/tp/renderer.rb', line 3

def text
  @text
end

Instance Method Details

#renderObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/tp/renderer.rb', line 9

def render
  Screen.clear!

  return unless text

  Screen.print text

  Screen.hide_cursor

  true
end