Class: Xudoku::Cli::Screens::Menu
- Defined in:
- lib/xudoku/cli/screens/menu.rb
Overview
:nodoc:
Constant Summary collapse
- TOP_PADDING =
2- MENU_HORIZONTAL_PADDING =
5- MENU_TOP_PADDING =
10- SELECTED =
"⬤"- NEW_PUZZLE =
"New puzzle"- QUIT =
"Quit"- HEADING =
"Xudoku"- MENU_ITEMS =
[ NEW_PUZZLE, QUIT ].freeze
Constants inherited from Base
Base::TITLE, Base::TITLE_HEIGHT
Instance Attribute Summary collapse
-
#heading_text ⇒ Object
readonly
Returns the value of attribute heading_text.
-
#selected_index ⇒ Object
readonly
Returns the value of attribute selected_index.
Attributes inherited from Base
#app, #first_render, #io, #reader
Instance Method Summary collapse
Methods inherited from Base
#initialize, #redraw!, #render
Constructor Details
This class inherits a constructor from Xudoku::Cli::Screens::Base
Instance Attribute Details
#heading_text ⇒ Object (readonly)
Returns the value of attribute heading_text.
25 26 27 |
# File 'lib/xudoku/cli/screens/menu.rb', line 25 def heading_text @heading_text end |
#selected_index ⇒ Object (readonly)
Returns the value of attribute selected_index.
25 26 27 |
# File 'lib/xudoku/cli/screens/menu.rb', line 25 def selected_index @selected_index end |
Instance Method Details
#paint_screen(event = nil) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/xudoku/cli/screens/menu.rb', line 32 def paint_screen(event = nil) handle_event(event) unless event.nil? render_heading if first_render? hide_cursor move_cursor_to_corner end |
#setup ⇒ Object
27 28 29 30 |
# File 'lib/xudoku/cli/screens/menu.rb', line 27 def setup @selected_index = 0 @heading_text = Artii::Base.new.asciify(HEADING) end |