Module: Roast::TaskContext

Extended by:
TaskContext
Included in:
TaskContext
Defined in:
lib/roast/task_context.rb

Defined Under Namespace

Classes: PathElement

Instance Method Summary collapse

Instance Method Details

#begin_cog(cog) ⇒ Object

: (Cog) -> Array



28
29
30
# File 'lib/roast/task_context.rb', line 28

def begin_cog(cog)
  begin_element(PathElement.new(cog:))
end

#begin_execution_manager(execution_manager) ⇒ Object

: (ExecutionManager) -> Array



33
34
35
# File 'lib/roast/task_context.rb', line 33

def begin_execution_manager(execution_manager)
  begin_element(PathElement.new(execution_manager:))
end

#endObject

: () -> [PathElement, Array]



38
39
40
41
42
# File 'lib/roast/task_context.rb', line 38

def end
  Event << { end: Fiber[:path]&.last }
  el = Fiber[:path]&.pop
  [el, path]
end

#pathObject

: () -> Array



23
24
25
# File 'lib/roast/task_context.rb', line 23

def path
  Fiber[:path]&.deep_dup || []
end