Class: Novel::Context

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/novel/context.rb

Defined Under Namespace

Modules: Types

Constant Summary collapse

INIT_SAGA_STATUS =
'started'.freeze

Instance Method Summary collapse

Instance Method Details

#compensation_step(step) ⇒ Object



42
43
44
# File 'lib/novel/context.rb', line 42

def compensation_step(step)
  attributes[:compensation_step_results][step]
end

#completed_compensation_stepsObject



46
47
48
# File 'lib/novel/context.rb', line 46

def completed_compensation_steps
  attributes[:compensation_step_results].keys
end

#completed_stepsObject



38
39
40
# File 'lib/novel/context.rb', line 38

def completed_steps
  attributes[:step_results].keys
end

#failed?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/novel/context.rb', line 30

def failed?
  attributes[:failed]
end

#step(step) ⇒ Object



34
35
36
# File 'lib/novel/context.rb', line 34

def step(step)
  attributes[:step_results][step]
end

#success?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/novel/context.rb', line 26

def success?
  !attributes[:failed]
end