Class: Flows::SharedContextPipeline::Track Private

Inherits:
Object
  • Object
show all
Defined in:
lib/flows/shared_context_pipeline/track.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0

Constant Summary collapse

TRACK_ENTRY_ROUTER_DEF =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0

RouterDefinition.new(
  Flows::Result::Ok => :next,
  Flows::Result::Err => :end
)

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Track

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Track.

Since:

  • 0.4.0



10
11
12
13
# File 'lib/flows/shared_context_pipeline/track.rb', line 10

def initialize(name)
  @name = name
  @step_list = []
end

Instance Method Details

#add_step(step) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0



19
20
21
22
23
24
25
26
# File 'lib/flows/shared_context_pipeline/track.rb', line 19

def add_step(step)
  last_step = @step_list.last
  last_step.next_step = step.name if last_step

  @step_list << step

  self
end

#empty?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 0.4.0



32
33
34
# File 'lib/flows/shared_context_pipeline/track.rb', line 32

def empty?
  @step_list.empty?
end

#first_step_nameObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0



28
29
30
# File 'lib/flows/shared_context_pipeline/track.rb', line 28

def first_step_name
  @step_list.first.name
end

#initialize_dup(_other) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0



15
16
17
# File 'lib/flows/shared_context_pipeline/track.rb', line 15

def initialize_dup(_other)
  @step_list = @step_list.map(&:dup)
end

#to_node_map(method_source) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0



36
37
38
39
40
# File 'lib/flows/shared_context_pipeline/track.rb', line 36

def to_node_map(method_source)
  @step_list.each_with_object(@name => make_track_entry_node) do |step, node_map|
    node_map[step.name] = step.to_node(method_source)
  end
end