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.

Revisions

  1. e-jambon created this gist Jun 24, 2016.
    10 changes: 10 additions & 0 deletions tty_prompt_selet_usage.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    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}"