Class: Percheron::Actions::Restart

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/percheron/actions/restart.rb

Instance Method Summary collapse

Methods included from Base

#base_dir, #in_working_directory

Constructor Details

#initialize(unit) ⇒ Restart

Returns a new instance of Restart.



6
7
8
# File 'lib/percheron/actions/restart.rb', line 6

def initialize(unit)
  @unit = unit
end

Instance Method Details

#execute!Object



10
11
12
13
14
15
# File 'lib/percheron/actions/restart.rb', line 10

def execute!
  results = []
  results << stop!
  results << start!
  results.compact.empty? ? nil : unit
end