Module: SubmenuDemo
- Includes:
- DiscreteMathTopics::PreliminaryMath
- Defined in:
- lib/modules/menus/submenu_demo.rb
Constant Summary collapse
- EXIT_SUB_MENU_OPTIONS =
["0"]
Class Method Summary collapse
Methods included from AlgorithmDemo
run, run_spinner, show_status_of_threads
Methods included from ShasumDemo
get_checksum_for_gem, is_gem?, run, valid_shasum?
Class Method Details
.show_choices_sub_menu ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/modules/menus/submenu_demo.rb', line 23 def self. Menu.("sub_demo") user_input = "" while not EXIT_SUB_MENU_OPTIONS.include? user_input user_input = gets.chomp case user_input when "0" Menu. when "1" ShasumDemo.run MenuHelpers.("sub_demo") . when "2" AlgorithmDemo.run MenuHelpers.("sub_demo") . when "3" PowersDemo::Calculate.run MenuHelpers.("sub_demo") . else MenuHelpers.("sub_demo") . end end end |
.show_sub_menu ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/modules/menus/submenu_demo.rb', line 10 def self. table = MenuHelpers.terminal_table do |t| t.title = 'Select a number' t.add_row [0, 'Back to main menu'] t.add_row [1, 'Demo SHA-256 Checksum'] t.add_row [2, 'Demo Algorithm'] t.add_row [3, 'Demo Power'] t.style = { all_separators: true } end puts table puts '' end |