Module: Xmi::ParserPipeline
- Defined in:
- lib/xmi/parser_pipeline.rb
Overview
Composable pipeline for XMI parsing.
Each step receives a context hash and returns an updated context hash. New concerns (validation, logging, caching) are added by inserting steps without modifying existing code — Open/Closed Principle.
Defined Under Namespace
Modules: Steps
Constant Summary collapse
- DEFAULT_STEPS =
[ Steps::FixEncoding, Steps::InitVersioning, Steps::ParseXml, Steps::BuildIndex, ].freeze
Class Method Summary collapse
-
.run(ctx, steps: DEFAULT_STEPS) ⇒ Hash
Run the pipeline with default or custom steps.
Class Method Details
.run(ctx, steps: DEFAULT_STEPS) ⇒ Hash
Run the pipeline with default or custom steps.
66 67 68 |
# File 'lib/xmi/parser_pipeline.rb', line 66 def self.run(ctx, steps: DEFAULT_STEPS) steps.reduce(ctx) { |context, step| step.call(context) } end |