Skip to content

Instantly share code, notes, and snippets.

@e-jambon
Created June 24, 2016 08:23
Show Gist options
  • Save e-jambon/cd9b663c8012fea68b880b4e74e12d24 to your computer and use it in GitHub Desktop.
Save e-jambon/cd9b663c8012fea68b880b4e74e12d24 to your computer and use it in GitHub Desktop.
require 'tty'
require 'tty-prompt'
prompt = TTY::Prompt.new
answer = prompt.select("my question") do |item|
item.choice 'One', 'Pika'
item.choice "Two", 'Boo'
end
puts "My answer was : #{answer}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment