Module: SubmenuDemo
Constant Summary
collapse
["0"]
Class Method Summary
collapse
Methods included from ShasumDemo
get_checksum_for_gem, is_gem?, run, valid_shasum?
Class Method Details
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/modules/menus/submenu_demo.rb', line 22
def self.
.("sub_demo")
user_input = ""
while not .include? user_input
user_input = gets.chomp
case user_input
when "0"
.show_choices_main_menu
when "1"
ShasumDemo.run
.("sub_demo")
.
when "2"
PowersDemo::Calculate.run
.("sub_demo")
.
else
.("sub_demo")
.
end
end
end
|
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/modules/menus/submenu_demo.rb', line 10
def self.
table = .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 Power']
t.style = { all_separators: true }
end
puts table
puts ''
end
|