Class: Maestro::Dispatcher
- Inherits:
-
Object
- Object
- Maestro::Dispatcher
- Defined in:
- lib/dispatcher.rb
Constant Summary collapse
- @@commands =
{}
Class Method Summary collapse
Class Method Details
.invoke(name, args) ⇒ Object
11 12 13 14 |
# File 'lib/dispatcher.rb', line 11 def invoke(name, args) return false unless commands.has_key?(name.to_sym) commands[name.to_sym].new(*args).invoke end |
.register(command) ⇒ Object
7 8 9 |
# File 'lib/dispatcher.rb', line 7 def register(command) commands[command.name] = command end |