Class: Flows::Railway::StepList Private
- Inherits:
-
Object
- Object
- Flows::Railway::StepList
- Defined in:
- lib/flows/railway/step_list.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.
Instance Method Summary collapse
- #add(name:, lambda: nil) ⇒ Object private
- #empty? ⇒ Boolean private
- #first_step_name ⇒ Object private
-
#initialize ⇒ StepList
constructor
private
A new instance of StepList.
- #initialize_dup(_other) ⇒ Object private
-
#to_node_map(method_source) ⇒ Object
private
:reek:FeatureEnvy
is false positive here.
Constructor Details
#initialize ⇒ StepList
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 StepList.
5 6 7 |
# File 'lib/flows/railway/step_list.rb', line 5 def initialize @list = [] end |
Instance Method Details
#add(name:, lambda: nil) ⇒ 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.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/flows/railway/step_list.rb', line 13 def add(name:, lambda: nil) step = Step.new(name: name, lambda: lambda) last_step = @list.last last_step.next_step = name if last_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.
33 34 35 |
# File 'lib/flows/railway/step_list.rb', line 33 def empty? @list.empty? end |
#first_step_name ⇒ 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.
24 25 26 |
# File 'lib/flows/railway/step_list.rb', line 24 def first_step_name @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.
9 10 11 |
# File 'lib/flows/railway/step_list.rb', line 9 def initialize_dup(_other) @list = @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.
:reek:FeatureEnvy
is false positive here.
29 30 31 |
# File 'lib/flows/railway/step_list.rb', line 29 def to_node_map(method_source) @list.map { |step| [step.name, step.to_node(method_source)] }.to_h end |