Class: Percheron::Actions::Stop

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

Instance Method Summary collapse

Methods included from Base

#base_dir, #in_working_directory

Constructor Details

#initialize(unit) ⇒ Stop

Returns a new instance of Stop.



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

def initialize(unit)
  @unit = unit
end

Instance Method Details

#execute!Object



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

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