Class: Sanford::ProcessSignal

Inherits:
Object
  • Object
show all
Defined in:
lib/sanford/process_signal.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server, signal) ⇒ ProcessSignal

Returns a new instance of ProcessSignal.



9
10
11
12
# File 'lib/sanford/process_signal.rb', line 9

def initialize(server, signal)
  @signal = signal
  @pid = PIDFile.new(server.pid_file).pid
end

Instance Attribute Details

#pidObject (readonly)

Returns the value of attribute pid.



7
8
9
# File 'lib/sanford/process_signal.rb', line 7

def pid
  @pid
end

#signalObject (readonly)

Returns the value of attribute signal.



7
8
9
# File 'lib/sanford/process_signal.rb', line 7

def signal
  @signal
end

Instance Method Details

#sendObject



14
15
16
# File 'lib/sanford/process_signal.rb', line 14

def send
  ::Process.kill(@signal, @pid)
end