Class: NulogyMessageBusConsumer::Pipeline
- Inherits:
-
Object
- Object
- NulogyMessageBusConsumer::Pipeline
- Defined in:
- lib/nulogy_message_bus_consumer/pipeline.rb
Instance Method Summary collapse
- #append(step) ⇒ Object
-
#initialize(steps) ⇒ Pipeline
constructor
A new instance of Pipeline.
- #insert(step, after:) ⇒ Object
- #invoke ⇒ Object
Constructor Details
#initialize(steps) ⇒ Pipeline
Returns a new instance of Pipeline.
3 4 5 |
# File 'lib/nulogy_message_bus_consumer/pipeline.rb', line 3 def initialize(steps) @steps = steps end |
Instance Method Details
#append(step) ⇒ Object
16 17 18 |
# File 'lib/nulogy_message_bus_consumer/pipeline.rb', line 16 def append(step) @steps << step end |
#insert(step, after:) ⇒ Object
11 12 13 14 |
# File 'lib/nulogy_message_bus_consumer/pipeline.rb', line 11 def insert(step, after:) index = @steps.find_index { |s| s.is_a?(after) } @steps.insert(index + 1, step) end |
#invoke ⇒ Object
7 8 9 |
# File 'lib/nulogy_message_bus_consumer/pipeline.rb', line 7 def invoke convert_steps_into_lambda.call end |