Class: LittleGhost::Sandbox::Execution
- Inherits:
-
Data
- Object
- Data
- LittleGhost::Sandbox::Execution
- Defined in:
- lib/little_ghost/sandbox.rb,
lib/little_ghost/sandbox.rb
Overview
Carries captured process output, exit status, and an optional execution error from Sandbox#execute or Sandbox#execute_program.
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#exit_code ⇒ Object
readonly
Returns the value of attribute exit_code.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
-
#initialize(stdout:, stderr:, exit_code:, error: nil) ⇒ Execution
constructor
A new instance of Execution.
- #success? ⇒ Boolean
Constructor Details
#initialize(stdout:, stderr:, exit_code:, error: nil) ⇒ Execution
Returns a new instance of Execution.
78 79 80 |
# File 'lib/little_ghost/sandbox.rb', line 78 def initialize(stdout:, stderr:, exit_code:, error: nil) super end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error
77 78 79 |
# File 'lib/little_ghost/sandbox.rb', line 77 def error @error end |
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code
77 78 79 |
# File 'lib/little_ghost/sandbox.rb', line 77 def exit_code @exit_code end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr
77 78 79 |
# File 'lib/little_ghost/sandbox.rb', line 77 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout
77 78 79 |
# File 'lib/little_ghost/sandbox.rb', line 77 def stdout @stdout end |
Instance Method Details
#success? ⇒ Boolean
82 83 84 |
# File 'lib/little_ghost/sandbox.rb', line 82 def success? error.nil? && exit_code&.zero? end |