Class: Shelley::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/shelley/registry.rb

Overview

A command

Instance Method Summary collapse

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