Class: Opencdd::Cddal::ImportPipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/opencdd/cddal/import_pipeline.rb

Overview

Handles CDDAL module imports: resolution, cycle detection, recursive sub-document building, and symbol scoping.

Extracted from Builder so the import pipeline has its own testable interface. Builder creates an ImportPipeline and delegates apply_import_declarations to it.

The pipeline holds shared mutable state (loaded_modules, loading_stack) that persists across recursive sub-builds. This state is passed by reference from the parent Builder so all levels of the import tree share the same cycle tracking.

Instance Method Summary collapse

Constructor Details

#initialize(database:, resolver:, source_file:, loaded_modules:, loading_stack:, qualified_table:) ⇒ ImportPipeline

Returns a new instance of ImportPipeline.



18
19
20
21
22
23
24
25
# File 'lib/opencdd/cddal/import_pipeline.rb', line 18

def initialize(database:, resolver:, source_file:, loaded_modules:, loading_stack:, qualified_table:)
  @database = database
  @resolver = resolver
  @source_file = source_file
  @loaded_modules = loaded_modules
  @loading_stack = loading_stack
  @qualified_table = qualified_table
end

Instance Method Details

#process(import_declarations) ⇒ Object



27
28
29
# File 'lib/opencdd/cddal/import_pipeline.rb', line 27

def process(import_declarations)
  import_declarations.each { |decl| process_import(decl) }
end