Skip to content

Instantly share code, notes, and snippets.

@Eiam8821
Created January 7, 2021 06:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Eiam8821/1cda292f5d875f461b99647d19b0b28c to your computer and use it in GitHub Desktop.
Save Eiam8821/1cda292f5d875f461b99647d19b0b28c to your computer and use it in GitHub Desktop.
prompt = TTY::Prompt.new
menu_choices = [ {name: "A", key:1},{name:"B", key:2},{name: "C", key:3}, {name: "D", key:4}]
prompt.select("Pick one:", menu_choices)
# You can specify :key as an additional option which will be used as short name for selecting the choice via keyboard key press.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment