Class: Matheus::Qs

Inherits:
Command show all
Defined in:
lib/matheus/qs.rb

Overview

Usage:

$ qs
Lists the questions asked and their answers.

Instance Method Summary collapse

Methods inherited from Command

call

Methods included from StringFormat

#bold, #error, #red

Methods included from Result::Methods

#Failure, #Success

Instance Method Details

#call(_) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/matheus/qs.rb', line 10

def call(_)
  return puts "No questions found in history." if history.empty?

  answer = prompt.select("Question:", choices, per_page: 10)
  print_markdown(answer)
rescue => e
  Failure(e.message)
end