Module: Lhm::Command

Included in:
Chunker, Entangler, LockedSwitcher, Migrator
Defined in:
lib/lhm/command.rb

Instance Method Summary collapse

Instance Method Details

#run(&block) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/lhm/command.rb', line 9

def run(&block)
  validate

  if(block_given?)
    before
    block.call(self)
    after
  else
    execute
  end
rescue
  revert
  raise
end