Method: Clin::Shell#choose
- Defined in:
- lib/clin/shell.rb
#choose(statement, choices, default: nil, allow_initials: false) ⇒ Object
Ask a question and expect the result to be in the list of choices Will continue asking until the input is correct or if a default value is supplied then empty will return. If multiple choices start with the same initial ONLY the first one will be able to be selected using its initial
61 62 63 64 |
# File 'lib/clin/shell.rb', line 61 def choose(statement, choices, default: nil, allow_initials: false) Clin::ShellInteraction::Choose.new(self).run(statement, choices, default: default, allow_initials: allow_initials) end |