Class: GoodJob::ExecutionResult

Inherits:
Object
  • Object
show all
Defined in:
lib/good_job/execution_result.rb

Overview

Stores the results of job execution

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value:, handled_error: nil, unhandled_error: nil) ⇒ ExecutionResult

Returns a new instance of ExecutionResult.

Parameters:

  • value (Object, nil)
  • handled_error (Exception, nil) (defaults to: nil)
  • unhandled_error (Exception, nil) (defaults to: nil)


15
16
17
18
19
# File 'lib/good_job/execution_result.rb', line 15

def initialize(value:, handled_error: nil, unhandled_error: nil)
  @value = value
  @handled_error = handled_error
  @unhandled_error = unhandled_error
end

Instance Attribute Details

#handled_errorException? (readonly)

Returns:

  • (Exception, nil)


8
9
10
# File 'lib/good_job/execution_result.rb', line 8

def handled_error
  @handled_error
end

#unhandled_errorException? (readonly)

Returns:

  • (Exception, nil)


10
11
12
# File 'lib/good_job/execution_result.rb', line 10

def unhandled_error
  @unhandled_error
end

#valueObject? (readonly)

Returns:

  • (Object, nil)


6
7
8
# File 'lib/good_job/execution_result.rb', line 6

def value
  @value
end