diff options
Diffstat (limited to 'lib/banzai/pipeline/combined_pipeline.rb')
-rw-r--r-- | lib/banzai/pipeline/combined_pipeline.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/banzai/pipeline/combined_pipeline.rb b/lib/banzai/pipeline/combined_pipeline.rb new file mode 100644 index 00000000000..f3bf1809d18 --- /dev/null +++ b/lib/banzai/pipeline/combined_pipeline.rb @@ -0,0 +1,27 @@ +require 'banzai' + +module Banzai + module Pipeline + module CombinedPipeline + def self.new(*pipelines) + Class.new(BasePipeline) do + const_set :PIPELINES, pipelines + + def self.pipelines + self::PIPELINES + end + + def self.filters + pipelines.flat_map(&:filters) + end + + def self.transform_context(context) + pipelines.reduce(context) do |context, pipeline| + pipeline.transform_context(context) + end + end + end + end + end + end +end |