Class: Microsandbox::ExitStatus
- Inherits:
-
Object
- Object
- Microsandbox::ExitStatus
- Defined in:
- lib/microsandbox/exec_handle.rb
Overview
The terminal status of a streamed execution (Microsandbox::ExecHandle#wait) or of a sandbox process (Sandbox#wait, Sandbox#stop_and_wait).
Instance Attribute Summary collapse
-
#exit_code ⇒ Integer?
readonly
The exit code, or nil when the process was terminated by a signal and so carries no code (e.g. a SIGKILL’d sandbox from Sandbox#kill then Sandbox#wait) — check #success? in that case.
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(data) ⇒ ExitStatus
constructor
A new instance of ExitStatus.
- #success? ⇒ Boolean
Constructor Details
#initialize(data) ⇒ ExitStatus
Returns a new instance of ExitStatus.
49 50 51 52 |
# File 'lib/microsandbox/exec_handle.rb', line 49 def initialize(data) @exit_code = data["exit_code"] @success = data["success"] end |
Instance Attribute Details
#exit_code ⇒ Integer? (readonly)
Returns the exit code, or nil when the process was terminated by a signal and so carries no code (e.g. a SIGKILL’d sandbox from Sandbox#kill then Sandbox#wait) — check #success? in that case.
47 48 49 |
# File 'lib/microsandbox/exec_handle.rb', line 47 def exit_code @exit_code end |
Instance Method Details
#failure? ⇒ Boolean
55 |
# File 'lib/microsandbox/exec_handle.rb', line 55 def failure? = !@success |
#success? ⇒ Boolean
54 |
# File 'lib/microsandbox/exec_handle.rb', line 54 def success? = @success |