Class: CobraCommander::CommandHandler
- Inherits:
-
Object
- Object
- CobraCommander::CommandHandler
- Defined in:
- lib/cobracommander/command_handler.rb
Overview
Abstract
Instance Method Summary collapse
-
#handle(command) ⇒ Object
NOTE: If you need validation, implement it in this method in the Child CommandHandler.
-
#unhandle(command) ⇒ Object
Mixed.
-
#validate(*args) ⇒ Object
NOTE: Leaving this in until I can figure out a more sensible way to validate arguments If this stays, I plan to call validate(command).execute() within the handle() method in order to provide validation without having to overwrite handle().
Instance Method Details
#handle(command) ⇒ Object
NOTE: If you need validation, implement it in this method in the Child CommandHandler
8 9 10 |
# File 'lib/cobracommander/command_handler.rb', line 8 def handle(command) command.execute end |
#unhandle(command) ⇒ Object
Returns mixed.
14 15 16 |
# File 'lib/cobracommander/command_handler.rb', line 14 def unhandle(command) command.unexecute end |
#validate(*args) ⇒ Object
NOTE: Leaving this in until I can figure out a more sensible way to validate arguments
If this stays, I plan to call validate(command).execute() within the handle() method in order to provide validation without having to overwrite handle()
20 21 22 |
# File 'lib/cobracommander/command_handler.rb', line 20 def validate(*args) end |