2015-12-15 14:51:16 +00:00
|
|
|
module Banzai
|
|
|
|
module Pipeline
|
2015-10-21 10:18:23 +00:00
|
|
|
module CombinedPipeline
|
|
|
|
def self.new(*pipelines)
|
2015-12-15 14:51:16 +00:00
|
|
|
Class.new(BasePipeline) do
|
2015-10-21 10:18:23 +00:00
|
|
|
const_set :PIPELINES, pipelines
|
|
|
|
|
2015-12-08 11:29:48 +00:00
|
|
|
def self.pipelines
|
|
|
|
self::PIPELINES
|
|
|
|
end
|
|
|
|
|
2015-10-21 10:18:23 +00:00
|
|
|
def self.filters
|
2016-03-01 20:54:35 +00:00
|
|
|
FilterArray.new(pipelines.flat_map(&:filters))
|
2015-10-21 10:18:23 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.transform_context(context)
|
2015-12-08 11:29:48 +00:00
|
|
|
pipelines.reduce(context) do |context, pipeline|
|
|
|
|
pipeline.transform_context(context)
|
|
|
|
end
|
2015-10-21 10:18:23 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|