class Flows::SharedContextPipeline::RouterDefinition

@api private

Public Class Methods

new(routes = {}) click to toggle source
# File lib/flows/shared_context_pipeline/router_definition.rb, line 5
def initialize(routes = {})
  @routes = routes
end

Public Instance Methods

to_router(next_step) click to toggle source

:reek: ControlParameter is false positive here

# File lib/flows/shared_context_pipeline/router_definition.rb, line 10
def to_router(next_step)
  final_routes = @routes.transform_values do |route|
    next route unless route == :next

    next_step || :end
  end

  ::Flows::Flow::Router::Custom.new(final_routes)
end