Class: Percheron::Actions::Stop
- Inherits:
-
Object
- Object
- Percheron::Actions::Stop
- Includes:
- Base
- Defined in:
- lib/percheron/actions/stop.rb
Instance Method Summary collapse
- #execute! ⇒ Object
-
#initialize(unit) ⇒ Stop
constructor
A new instance of Stop.
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 |