Method: App42::Base::Util#input
- Defined in:
- lib/app42/base/util.rb
#input(message, choices, indexed = true) ⇒ Object
Reading input from user
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/app42/base/util.rb', line 23 def input , choices, indexed = true if choices.empty? ans = ask Paint["#{}", :cyan] else list = choices.compact unless choices.empty? ans = ask Paint["#{}", :cyan], :choices => list, :default => list[0], :indexed => indexed end print_new_line return ans end |