Class: Lutaml::Xsd::SchemaDependencyAnalyzer
- Inherits:
-
Object
- Object
- Lutaml::Xsd::SchemaDependencyAnalyzer
- Defined in:
- lib/lutaml/xsd/schema_dependency_analyzer.rb
Overview
Analyzes schema dependencies and builds dependency trees
Instance Attribute Summary collapse
-
#package ⇒ Object
readonly
Returns the value of attribute package.
Instance Method Summary collapse
-
#build_dependency_tree(entrypoints, depth: nil) ⇒ Array<Hash>
Build dependency tree from entrypoints.
-
#initialize(package) ⇒ SchemaDependencyAnalyzer
constructor
A new instance of SchemaDependencyAnalyzer.
Constructor Details
#initialize(package) ⇒ SchemaDependencyAnalyzer
Returns a new instance of SchemaDependencyAnalyzer.
10 11 12 |
# File 'lib/lutaml/xsd/schema_dependency_analyzer.rb', line 10 def initialize(package) @package = package end |
Instance Attribute Details
#package ⇒ Object (readonly)
Returns the value of attribute package.
7 8 9 |
# File 'lib/lutaml/xsd/schema_dependency_analyzer.rb', line 7 def package @package end |
Instance Method Details
#build_dependency_tree(entrypoints, depth: nil) ⇒ Array<Hash>
Build dependency tree from entrypoints
18 19 20 21 22 23 24 25 26 |
# File 'lib/lutaml/xsd/schema_dependency_analyzer.rb', line 18 def build_dependency_tree(entrypoints, depth: nil) package.load_repository visited = Set.new entrypoints.map do |entrypoint| build_tree_node(entrypoint[:schema], entrypoint[:file], visited, 0, depth) end end |