Class: Tui::Settings

Inherits:
Data
  • Object
show all
Defined in:
lib/tui/settings.rb

Overview

Settings for the TUI.

  • target_fps - how frequently you want the content to refresh. It's useful to control CPU, console I/O and data fetching usage
  • window_size - size of the main window, e.g. { height: 70, width: 200 }
  • draw_main_window - whether to fit content in a box and center it by default within window

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target_fps: 30, window_size: { height: 70, width: 200 }.freeze, draw_main_window: true) ⇒ Settings

Returns a new instance of Settings.



7
8
9
10
11
12
# File 'lib/tui/settings.rb', line 7

def initialize(
  target_fps: 30,
  window_size: { height: 70, width: 200 }.freeze,
  draw_main_window:  true)
    super(target_fps:, window_size:, draw_main_window:)
end

Instance Attribute Details

#draw_main_window ⇒ Object (readonly)

Returns the value of attribute draw_main_window

Returns:

  • (Object) —

    the current value of draw_main_window



6
7
8
# File 'lib/tui/settings.rb', line 6

def draw_main_window
  @draw_main_window
end

#target_fps ⇒ Object (readonly)

Returns the value of attribute target_fps

Returns:

  • (Object) —

    the current value of target_fps



6
7
8
# File 'lib/tui/settings.rb', line 6

def target_fps
  @target_fps
end

#window_size ⇒ Object (readonly)

Returns the value of attribute window_size

Returns:

  • (Object) —

    the current value of window_size



6
7
8
# File 'lib/tui/settings.rb', line 6

def window_size
  @window_size
end