Class: CommandProcessor::Processor
- Inherits:
-
Object
- Object
- CommandProcessor::Processor
- Defined in:
- lib/command_processor/processor.rb
Instance Method Summary collapse
- #execute(command) ⇒ Object
-
#initialize ⇒ Processor
constructor
A new instance of Processor.
- #register(*args, &block) ⇒ Object
Constructor Details
Instance Method Details
#execute(command) ⇒ Object
13 14 15 16 17 |
# File 'lib/command_processor/processor.rb', line 13 def execute(command) handler_class = Object.const_get("#{command.class.name}Handler") handler = @container.resolve_by_type(handler_class) handler.execute(command) end |
#register(*args, &block) ⇒ Object
9 10 11 |
# File 'lib/command_processor/processor.rb', line 9 def register(*args, &block) @container.register(*args, &block) end |