Sha256: aa29baa202ec5a7ae79be5334e4659ba22565b4be77d69407283f010d872538c
Contents?: true
Size: 441 Bytes
Versions: 10
Compression:
Stored size: 441 Bytes
Contents
# aia/lia/aia/user_query.rb require 'reline' module AIA::UserQuery # Function to prompt the user with a question using reline def ask_question_with_reline(prompt) if prompt.start_with?("\n") puts puts prompt = prompt[1..] end answer = Reline.readline(prompt) Reline::HISTORY.push(answer) unless answer.nil? || Reline::HISTORY.to_a.include?(answer) answer rescue Interrupt '' end end
Version data entries
10 entries across 10 versions & 1 rubygems