Class: Ask::Sandbox::Result
- Inherits:
-
Data
- Object
- Data
- Ask::Sandbox::Result
- Defined in:
- lib/ask/sandbox/base.rb
Overview
Structured result from a sandbox command execution.
Instance Attribute Summary collapse
-
#exit_code ⇒ Integer?
readonly
Process exit code (nil if killed by signal).
-
#stderr ⇒ String
readonly
Captured standard error.
-
#stdout ⇒ String
readonly
Captured standard output.
-
#timed_out ⇒ Boolean
readonly
Whether execution was terminated due to timeout.
Instance Method Summary collapse
-
#success? ⇒ Boolean
True if the command exited successfully (exit code 0).
Instance Attribute Details
#exit_code ⇒ Integer? (readonly)
Returns process exit code (nil if killed by signal).
31 32 33 34 35 36 |
# File 'lib/ask/sandbox/base.rb', line 31 Result = Data.define(:stdout, :stderr, :exit_code, :timed_out) do # @return [Boolean] true if the command exited successfully (exit code 0) def success? exit_code == 0 end end |
#stderr ⇒ String (readonly)
Returns captured standard error.
31 32 33 34 35 36 |
# File 'lib/ask/sandbox/base.rb', line 31 Result = Data.define(:stdout, :stderr, :exit_code, :timed_out) do # @return [Boolean] true if the command exited successfully (exit code 0) def success? exit_code == 0 end end |
#stdout ⇒ String (readonly)
Returns captured standard output.
31 32 33 34 35 36 |
# File 'lib/ask/sandbox/base.rb', line 31 Result = Data.define(:stdout, :stderr, :exit_code, :timed_out) do # @return [Boolean] true if the command exited successfully (exit code 0) def success? exit_code == 0 end end |
#timed_out ⇒ Boolean (readonly)
Returns whether execution was terminated due to timeout.
31 32 33 34 35 36 |
# File 'lib/ask/sandbox/base.rb', line 31 Result = Data.define(:stdout, :stderr, :exit_code, :timed_out) do # @return [Boolean] true if the command exited successfully (exit code 0) def success? exit_code == 0 end end |
Instance Method Details
#success? ⇒ Boolean
Returns true if the command exited successfully (exit code 0).
33 34 35 |
# File 'lib/ask/sandbox/base.rb', line 33 def success? exit_code == 0 end |