Sha256: e4cd8fc74cb525d09222dd54d3d7da9bcc84579a5e15db702f418bd4618f0df9

Contents?: true

Size: 984 Bytes

Versions: 6

Compression:

Stored size: 984 Bytes

Contents

# frozen_string_literal: true

module Blacklight
  module Rendering
    # The field rendering pipeline
    class Pipeline
      class_attribute :operations

      # The ordered list of pipeline operations
      self.operations = [HelperMethod, LinkToFacet, Microdata, Join]

      def initialize(values, config, document, context, options)
        @values = values
        @config = config
        @document = document
        @context = context
        @options = options
      end

      attr_reader :values, :config, :document, :context, :options

      def self.render(values, config, document, context, options)
        new(values, config, document, context, options).render
      end

      def render
        first, *rest = *stack
        first.new(values, config, document, context, options, rest).render
      end

      private

      # Ordered list of operations, Terminator must be at the end.
      def stack
        operations + [Terminator]
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
blacklight-7.2.0 app/presenters/blacklight/rendering/pipeline.rb
blacklight-7.1.0 app/presenters/blacklight/rendering/pipeline.rb
blacklight-7.1.0.alpha app/presenters/blacklight/rendering/pipeline.rb
blacklight-7.0.1 app/presenters/blacklight/rendering/pipeline.rb
blacklight-7.0.0 app/presenters/blacklight/rendering/pipeline.rb
blacklight-7.0.0.rc2 app/presenters/blacklight/rendering/pipeline.rb