Exception: Linearly::Errors::StateNotReturned

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/linearly/errors/state_not_returned.rb

Overview

StateNotReturned is an error that is getting thrown when one of Steps in the Flow does not return an instance of Statefully::State.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output:, step:) ⇒ StateNotReturned

Constructor for the Linearly::Errors::StateNotReturned class

Examples:

Linearly::Errors::StateNotReturned
  .new(output: 'surprise', step: 'step')

Parameters:

  • output: (Object)
  • step: (String)


38
39
40
41
42
43
# File 'lib/linearly/errors/state_not_returned.rb', line 38

def initialize(output:, step:)
  str = output.inspect
  super("#{str}, returned from #{step}, is not a Statefully::State")
  @output = output
  @step = step
end

Instance Attribute Details

#outputObject (readonly)

Value that caused the error

Examples:

Linearly::Errors::StateNotReturned
  .new(output: 'surprise', step: 'step')
  .output
=> "surprise"

Returns:

  • (Object)


16
17
18
# File 'lib/linearly/errors/state_not_returned.rb', line 16

def output
  @output
end

#stepObject (readonly)

Name of the step that caused the error

Examples:

Linearly::Errors::StateNotReturned
  .new(output: 'surprise', step: 'step')
  .step
=> "step"

Returns:

  • String



27
28
29
# File 'lib/linearly/errors/state_not_returned.rb', line 27

def step
  @step
end