Method: Menu#show

Defined in:
lib/artsy/menu.rb

#showObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/artsy/menu.rb', line 29

def show()
  # print menu
  puts "#{@menutitle}"
  puts ""
  for i in 1..@optids.count
    # print each option
    n = i - 1 # to access strings via index
    puts "#{i}) #{@optstrings[n]}" # print the option
  end
  puts ""
  puts "Enter your selection: "
  @choice = gets.chomp
  puts "You entered #{@choice}."
  # now, we'll run some logic to ensure the choice was in @optids, then we can run the user's code!
  @choice = Integer(@choice) # make sure it is int
  @choice = @choice - 1 # convert to real
  @methodLoader.run(@choice)
end