Class: Ask::Sandbox::Result

Inherits:
Data
  • Object
show all
Defined in:
lib/ask/sandbox/base.rb

Overview

Structured result from a sandbox command execution.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#exit_codeObject (readonly)

Returns the value of attribute exit_code

Returns:

  • (Object)

    the current value of exit_code



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

#stderrObject (readonly)

Returns the value of attribute stderr

Returns:

  • (Object)

    the current value of stderr



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

#stdoutObject (readonly)

Returns the value of attribute stdout

Returns:

  • (Object)

    the current value of stdout



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_outObject (readonly)

Returns the value of attribute timed_out

Returns:

  • (Object)

    the current value of timed_out



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).

Returns:

  • (Boolean)

    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