Class: Insika::Sandbox::Result

Inherits:
Data
  • Object
show all
Defined in:
lib/insika/sandbox/runner.rb

Overview

Structured result of a sandboxed command. timed_out distinguishes a deadline kill (exit_status nil) from a normal exit. output is the combined stdout+stderr, already clipped to the provider's cap.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#exit_statusObject (readonly)

Returns the value of attribute exit_status

Returns:

  • (Object)

    the current value of exit_status



11
12
13
# File 'lib/insika/sandbox/runner.rb', line 11

def exit_status
  @exit_status
end

#outputObject (readonly)

Returns the value of attribute output

Returns:

  • (Object)

    the current value of output



11
12
13
# File 'lib/insika/sandbox/runner.rb', line 11

def output
  @output
end

#timed_outObject (readonly)

Returns the value of attribute timed_out

Returns:

  • (Object)

    the current value of timed_out



11
12
13
# File 'lib/insika/sandbox/runner.rb', line 11

def timed_out
  @timed_out
end

Instance Method Details

#timed_out?Boolean

Returns:

  • (Boolean)


12
13
# File 'lib/insika/sandbox/runner.rb', line 12

def timed_out? = timed_out
# Shape returned to the model by the bash tool (parity with the prototype).

#to_hObject

Shape returned to the model by the bash tool (parity with the prototype).



14
# File 'lib/insika/sandbox/runner.rb', line 14

def to_h = { exit_status: exit_status, output: output, timed_out: timed_out }