Class: Aocli::Cli

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

Instance Method Summary collapse

Constructor Details

#initializeCli

Returns a new instance of Cli.



5
6
7
8
# File 'lib/aocli/cli.rb', line 5

def initialize
  @options = Aocli::Config.load_config
  @prompt = TTY::Prompt.new
end

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/aocli/cli.rb', line 10

def run
  prompt_for_command
  prompt_command_options
  # Aocli::Commands::StartDay
  # Aocli::Commands::SaveCookie
  # Aocli::Commands::RemoveCookie
  # Aocli::Commands::SetTemplatePath
  # Aocli::Commands::RemoveTemplatePath
  options[:command].constantize.run!(options)
end