Class: RubyJard::ScreenRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_jard/screen_renderer.rb

Overview

Adjust the layout between screens, render row’s bitmap by calling RowRenderer, calculate screen window to ready for putting on the screen.

Instance Method Summary collapse

Constructor Details

#initialize(screen:, color_scheme:) ⇒ ScreenRenderer

Returns a new instance of ScreenRenderer.



8
9
10
11
# File 'lib/ruby_jard/screen_renderer.rb', line 8

def initialize(screen:, color_scheme:)
  @screen = screen
  @color_scheme = color_scheme
end

Instance Method Details

#renderObject



13
14
15
16
17
18
19
20
21
# File 'lib/ruby_jard/screen_renderer.rb', line 13

def render
  # Move this logic into a class called SreenRenderer
  calculate_content_lengths
  column_widths = calculate_column_widths
  adjust_column_widths(column_widths)
  calculate_window

  @screen
end