Class: Termplot::Renderer
- Inherits:
-
Object
- Object
- Termplot::Renderer
- Includes:
- Renderable
- Defined in:
- lib/termplot/renderer.rb
Instance Method Summary collapse
-
#initialize(cols: 80, rows: 20, debug: false, widgets:) ⇒ Renderer
constructor
A new instance of Renderer.
- #render_to_window ⇒ Object
Methods included from Renderable
#debug?, #render, #render_to_string
Constructor Details
#initialize(cols: 80, rows: 20, debug: false, widgets:) ⇒ Renderer
Returns a new instance of Renderer.
12 13 14 15 16 17 |
# File 'lib/termplot/renderer.rb', line 12 def initialize(cols: 80, rows: 20, debug: false, widgets:) @window = Window.new(cols: cols, rows: rows) @widgets = @debug = debug @errors = [] end |
Instance Method Details
#render_to_window ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/termplot/renderer.rb', line 19 def render_to_window window.clear errors.clear position = [0, 0] .each do || .render_to_window window.blit( .window, .row, .col ) @errors.concat(.errors) end end |