Class: Shelley::Command
- Inherits:
-
Object
- Object
- Shelley::Command
- Defined in:
- lib/shelley/registry.rb
Overview
A command
Instance Method Summary collapse
- #execute(*args) ⇒ Object
-
#initialize(method) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(method) ⇒ Command
Returns a new instance of Command.
52 53 54 |
# File 'lib/shelley/registry.rb', line 52 def initialize(method) @method = method end |
Instance Method Details
#execute(*args) ⇒ Object
56 57 58 59 60 |
# File 'lib/shelley/registry.rb', line 56 def execute(*args) @method.call(*args) rescue StandardError => msg raise CommandError, msg end |