Class: Rails::Hyperdrive::ConsoleExecutor::Result

Inherits:
Struct
  • Object
show all
Defined in:
lib/rails/hyperdrive/console_executor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#elapsed_msObject

Returns the value of attribute elapsed_ms

Returns:

  • (Object)

    the current value of elapsed_ms



9
10
11
# File 'lib/rails/hyperdrive/console_executor.rb', line 9

def elapsed_ms
  @elapsed_ms
end

#exceptionObject

Returns the value of attribute exception

Returns:

  • (Object)

    the current value of exception



9
10
11
# File 'lib/rails/hyperdrive/console_executor.rb', line 9

def exception
  @exception
end

#resultObject

Returns the value of attribute result

Returns:

  • (Object)

    the current value of result



9
10
11
# File 'lib/rails/hyperdrive/console_executor.rb', line 9

def result
  @result
end

#stderrObject

Returns the value of attribute stderr

Returns:

  • (Object)

    the current value of stderr



9
10
11
# File 'lib/rails/hyperdrive/console_executor.rb', line 9

def stderr
  @stderr
end

#stdoutObject

Returns the value of attribute stdout

Returns:

  • (Object)

    the current value of stdout



9
10
11
# File 'lib/rails/hyperdrive/console_executor.rb', line 9

def stdout
  @stdout
end

Instance Method Details

#to_hObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rails/hyperdrive/console_executor.rb', line 10

def to_h
  {
    result: result.inspect,
    stdout: stdout,
    stderr: stderr,
    elapsed_ms: elapsed_ms,
    exception: exception && {
      class: exception.class.name,
      message: exception.message,
      backtrace: Array(exception.backtrace).first(20)
    }
  }
end