Class: OSDb::Finder::Interactive
- Inherits:
-
Object
- Object
- OSDb::Finder::Interactive
- Defined in:
- lib/osdb/finder/interactive.rb
Instance Method Summary collapse
Instance Method Details
#chose(items) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/osdb/finder/interactive.rb', line 6 def chose(items) puts "D'oh! You stumbled upon a hash conflict, please resolve it:" puts items.each_with_index do |name, index| puts " #{index} - #{name}" end print 'id: ' str = STDIN.gets # TODO: rule #1, never trust user input puts items[str.to_i] end |