Class: ProcessWatcher::WatchStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/process_watcher/watcher.rb

Overview

Encapsulate information returned by watcher

Constant Summary collapse

VALID_STATUSES =

Potential outcome of watcher

[ :success, :timeout, :size_exceeded ]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, exit_code, output) ⇒ WatchStatus

Initialize attibutes



43
44
45
46
47
# File 'lib/process_watcher/watcher.rb', line 43

def initialize(status, exit_code, output)
  @status    = status
  @exit_code = exit_code
  @output    = output
end

Instance Attribute Details

#exit_codeObject (readonly)

Watched process exit code or -1 if process was killed



39
40
41
# File 'lib/process_watcher/watcher.rb', line 39

def exit_code
  @exit_code
end

#outputObject (readonly)

Watched process combined output



40
41
42
# File 'lib/process_watcher/watcher.rb', line 40

def output
  @output
end

#statusObject (readonly)

One of VALID_STATUSES



38
39
40
# File 'lib/process_watcher/watcher.rb', line 38

def status
  @status
end