Class: Mailbot::CommandFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/mailbot/command_factory.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ CommandFactory

Returns a new instance of CommandFactory.

Parameters:

  • argv (Array)

    ARGV



11
12
13
# File 'lib/mailbot/command_factory.rb', line 11

def initialize(argv)
  @argv = argv
end

Class Method Details

.create(*args) ⇒ Mailbot::Commands::Base



6
7
8
# File 'lib/mailbot/command_factory.rb', line 6

def self.create(*args)
  new(*args).create
end

Instance Method Details

#createMailbot::Commands::Base



16
17
18
19
20
# File 'lib/mailbot/command_factory.rb', line 16

def create
  command_class.new @argv
rescue Errors::CommandNotFound
  terminate
end