Module: One44::CLI::Helpers

Defined in:
lib/one44-cli/helpers.rb

Instance Method Summary collapse

Instance Method Details

#answerObject



6
7
8
# File 'lib/one44-cli/helpers.rb', line 6

def answer
  gets.chomp
end

#clean(answer) ⇒ Object



10
11
12
13
14
# File 'lib/one44-cli/helpers.rb', line 10

def clean(answer)
  Integer(answer).to_i
rescue StandardError
  nil
end

#questionsObject



20
21
22
# File 'lib/one44-cli/helpers.rb', line 20

def questions
  load_tests_from_csv_file('bin/tests/Advanced Indigo.txt', "\t\t")
end

#randomise(questions) ⇒ Object



16
17
18
# File 'lib/one44-cli/helpers.rb', line 16

def randomise(questions)
  questions.shuffle
end