Module: Banzai::Pipeline::CombinedPipeline

Defined in:
lib/banzai/pipeline/combined_pipeline.rb

Class Method Summary collapse

Class Method Details

.new(*pipelines) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/banzai/pipeline/combined_pipeline.rb', line 6

def self.new(*pipelines)
  Class.new(BasePipeline) do
    const_set :PIPELINES, pipelines

    def self.pipelines
      self::PIPELINES
    end

    def self.filters
      FilterArray.new(pipelines.flat_map(&:filters))
    end

    def self.transform_context(context)
      pipelines.reduce(context) do |context, pipeline|
        pipeline.transform_context(context)
      end
    end
  end
end