Class: Escape::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/escape/cli.rb

Instance Method Summary collapse

Instance Method Details

#restartObject



17
18
19
20
# File 'lib/escape/cli.rb', line 17

def restart
  Escape::Commands::Questions.new(self).start(configuration.questions, configuration.clues)
  Escape::Commands::Restart.new(self).restart_or_quit
end

#startObject

Raises:

  • (RuntimeError)


8
9
10
11
12
13
14
# File 'lib/escape/cli.rb', line 8

def start
  raise RuntimeError, "Number of questions does not match the number of clues" unless valid_configuration?

  Escape::Commands::Welcome.new(self).show(configuration.welcome_message)
  Escape::Commands::Questions.new(self).start(configuration.questions, configuration.clues)
  Escape::Commands::Restart.new(self).restart_or_quit
end