Method: Clio::Terminal.ask
- Defined in:
- lib/clio/consoleutils.rb
.ask(question, answers = nil) ⇒ Object
Convenient method to get simple console reply.
15 16 17 18 19 20 |
# File 'lib/clio/consoleutils.rb', line 15 def ask(question, answers=nil) print "#{question}" print " [#{answers}] " if answers until inp = $stdin.gets ; sleep 1 ; end inp end |