Class: Tui::Settings
- Inherits:
-
Data
- Object
- Data
- Tui::Settings
- 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
-
#draw_main_window ⇒ Object
readonly
Returns the value of attribute draw_main_window.
-
#target_fps ⇒ Object
readonly
Returns the value of attribute target_fps.
-
#window_size ⇒ Object
readonly
Returns the value of attribute window_size.
Instance Method Summary collapse
-
#initialize(target_fps: 30, window_size: { height: 70, width: 200 }.freeze, draw_main_window: true) ⇒ Settings
constructor
A new instance of Settings.
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
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
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
6 7 8 |
# File 'lib/tui/settings.rb', line 6 def window_size @window_size end |