class Percheron::Actions::Restart

Attributes

unit[R]

Public Class Methods

new(unit) click to toggle source
# File lib/percheron/actions/restart.rb, line 6
def initialize(unit)
  @unit = unit
end

Public Instance Methods

execute!() click to toggle source
# File lib/percheron/actions/restart.rb, line 10
def execute!
  results = []
  results << stop!
  results << start!
  results.compact.empty? ? nil : unit
end

Private Instance Methods

start!() click to toggle source
# File lib/percheron/actions/restart.rb, line 25
def start!
  opts = { needed_units: unit.startable_needed_units.values }
  Start.new(unit, opts).execute!
end
stop!() click to toggle source
# File lib/percheron/actions/restart.rb, line 21
def stop!
  Stop.new(unit).execute!
end