class ProcessHost::Signal::Substitute::Signal

Constants

Record

Public Instance Methods

handlers() click to toggle source
# File lib/process_host/signal.rb, line 31
def handlers
  @handlers ||= {}
end
records() click to toggle source
# File lib/process_host/signal.rb, line 35
def records
  @records ||= []
end
simulate_signal(signal) click to toggle source
# File lib/process_host/signal.rb, line 19
def simulate_signal(signal)
  handler = handlers[signal]

  return if handler.nil?

  handler.()

  record = Record.new signal
  records << record
  record
end
trap(signal, &handler) click to toggle source
# File lib/process_host/signal.rb, line 15
def trap(signal, &handler)
  handlers[signal] = handler
end