Sha256: b3a1334951542de4fe2436b2e147edb1160f9fc8cfafab07c7569870e30cb64d

Contents?: true

Size: 472 Bytes

Versions: 4

Compression:

Stored size: 472 Bytes

Contents

module Flows
  class SharedContextPipeline
    # @api private
    class RouterDefinition
      def initialize(routes = {})
        @routes = routes
      end

      # :reek:ControlParameter is false positive here
      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
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
flows-0.6.0 lib/flows/shared_context_pipeline/router_definition.rb
flows-0.5.1 lib/flows/shared_context_pipeline/router_definition.rb
flows-0.5.0 lib/flows/shared_context_pipeline/router_definition.rb
flows-0.4.0 lib/flows/shared_context_pipeline/router_definition.rb