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.
35 36 37 |
# File 'lib/little_ghost/sandbox.rb', line 35 def initialize(stdout:, stderr:, exit_code:, error: nil) super end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error
34 35 36 |
# File 'lib/little_ghost/sandbox.rb', line 34 def error @error end |
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code
34 35 36 |
# File 'lib/little_ghost/sandbox.rb', line 34 def exit_code @exit_code end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr
34 35 36 |
# File 'lib/little_ghost/sandbox.rb', line 34 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout
34 35 36 |
# File 'lib/little_ghost/sandbox.rb', line 34 def stdout @stdout end |
Instance Method Details
#success? ⇒ Boolean
39 40 41 |
# File 'lib/little_ghost/sandbox.rb', line 39 def success? error.nil? && exit_code&.zero? end |