Class: TP::Renderer
- Inherits:
-
Object
- Object
- TP::Renderer
- Defined in:
- lib/tp/renderer.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text) ⇒ Renderer
constructor
A new instance of Renderer.
- #render ⇒ Object
- #testing? ⇒ Boolean
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
#text ⇒ Object (readonly)
Returns the value of attribute text.
3 4 5 |
# File 'lib/tp/renderer.rb', line 3 def text @text end |
Instance Method Details
#render ⇒ Object
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 print text unless testing? Screen.hide_cursor true end |
#testing? ⇒ Boolean
21 22 23 |
# File 'lib/tp/renderer.rb', line 21 def testing? ENV['RUBY_ENV'] == 'test' end |