Class: StringPicker
- Inherits:
-
Object
- Object
- StringPicker
- Defined in:
- lib/string_picker.rb
Constant Summary collapse
- NUM_OPTIONS =
4- NUM_STRINGS =
5
Instance Method Summary collapse
Instance Method Details
#ask_user ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/string_picker.rb', line 6 def ask_user = () puts "Choose sentence" input = gets.chomp.to_i while !(1..NUM_OPTIONS).to_a.include?(input) puts "Try again" input = gets.chomp.to_i end [input] end |
#reply ⇒ Object
18 19 20 |
# File 'lib/string_picker.rb', line 18 def reply choose_random_string(:replies) end |