Class: Process::Status

Inherits:
Object
  • Object
show all
Defined in:
mrbgems/mruby-process/mrblib/status.rb

Overview

The way a process finished, as reported by Process.waitpid and left in $?.

The questions a status answers (#exited?, #exitstatus, #termsig and the rest) are decoded from the platform value by the process HAL. What is here is the part that reads the same everywhere.

Instance Method Summary collapse

Instance Method Details

#inspect ⇒ Object



17
18
19
# File 'mrbgems/mruby-process/mrblib/status.rb', line 17

def inspect
  "#<Process::Status: #{self}>"
end

#success? ⇒ Boolean

Whether the process exited with a status of zero.

Returns nil rather than false when the process did not exit at all, because "did it succeed?" has no answer for one that was signalled.

Returns:

  • (Boolean)


13
14
15
# File 'mrbgems/mruby-process/mrblib/status.rb', line 13

def success?
  exitstatus == 0 if exited?
end