Class: BotMob::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/bot_mob/command.rb

Overview

# BotMob::Command

This class handles all the ‘mob` command line interactions

Instance Method Summary collapse

Constructor Details

#initializeCommand

Returns a new instance of Command.



8
9
10
# File 'lib/bot_mob/command.rb', line 8

def initialize
  # parse_options!
end

Instance Method Details

#handle(argv) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/bot_mob/command.rb', line 12

def handle(argv)
  case argv[0].to_s.to_sym
  when :server then BotMob::Server.run!(@options || {})
  when :console then system("#{__dir__}/../../bin/console")
  else
    puts 'Usage: mob server [options]'
  end
end