Class: Morsel::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/morsel/runner.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Runner

Returns a new instance of Runner.



7
8
9
10
# File 'lib/morsel/runner.rb', line 7

def initialize(*args)
  @cmd = args.shift
  @args = args
end

Class Method Details

.execute(*args) ⇒ Object



3
4
5
# File 'lib/morsel/runner.rb', line 3

def self.execute(*args)
  new(*args).execute
end

Instance Method Details

#executeObject



12
13
14
# File 'lib/morsel/runner.rb', line 12

def execute
  Commands.send(@cmd, @args) if Commands.respond_to?(@cmd)
end