Class: Mailbot::CommandFactory
- Inherits:
-
Object
- Object
- Mailbot::CommandFactory
- Defined in:
- lib/mailbot/command_factory.rb
Class Method Summary collapse
Instance Method Summary collapse
- #create ⇒ Mailbot::Commands::Base
-
#initialize(argv) ⇒ CommandFactory
constructor
A new instance of CommandFactory.
Constructor Details
#initialize(argv) ⇒ CommandFactory
Returns a new instance of CommandFactory.
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
#create ⇒ Mailbot::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 |