Class: Mnemonicker::CLI

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

Class Method Summary collapse

Class Method Details

.run(*args) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/mnemonicker/cli.rb', line 12

def self.run(*args)
  cmd = args.shift
  cmd ||= 'help'
  cmd = cmd[0].upcase + cmd[1..-1]
  handler = Commands.const_get(cmd)
  handler.new.process(*args)
rescue NameError
  Commands::Help.new.process
end