Sha256: b4f944adcbdaeb0cc11c10dbda7710f4ed759281deb4162a5bdc215a806485c0

Contents?: true

Size: 953 Bytes

Versions: 1

Compression:

Stored size: 953 Bytes

Contents

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

1 entries across 1 versions & 1 rubygems

Version Path
blacklight-7.0.0.rc1 app/presenters/blacklight/rendering/pipeline.rb