lib/cli.rb
# Get definition number from user.
Get definition number from user.
Get definition number from user .
def ask_no
    puts 'Please enter a number 1-4:'
    input = gets.strip
    case input
    when '1'
      @question.defs[0] == @question.def ? correct : incorrect
    when '2'
      @question.defs[1] == @question.def ? correct : incorrect
    when '3'
      @question.defs[2] == @question.def ? correct : incorrect
    when '4'
      @question.defs[3] == @question.def ? correct : incorrect
    else
      ask_no
    end
  end
def ask_no puts 'Please enter a number 1-4:' input = gets . strip case input when '1' @question . defs [ 0 ] == @question . def ? correct : incorrect when '2' @question . defs [ 1 ] == @question . def ? correct : incorrect when '3' @question . defs [ 2 ] == @question . def ? correct : incorrect when '4' @question . defs [ 3 ] == @question . def ? correct : incorrect else ask_no end end
Get definition number from user.
Get definition number from user .