Class: StringPicker

Inherits:
Object
  • Object
show all
Defined in:
lib/string_picker.rb

Constant Summary collapse

NUM_OPTIONS =
4
NUM_STRINGS =
5

Instance Method Summary collapse

Instance Method Details

#ask_userObject



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/string_picker.rb', line 6

def ask_user
  options = generate_options
  print_options(options)
  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
  options[input]
end

#replyObject



18
19
20
# File 'lib/string_picker.rb', line 18

def reply
  choose_random_string(:replies)
end