Class: Lutaml::UmlRepository::StaticSite::Serializers::PackageTreeBuilder
- Inherits:
-
Base
- Object
- Base
- Lutaml::UmlRepository::StaticSite::Serializers::PackageTreeBuilder
- Defined in:
- lib/lutaml/uml_repository/static_site/serializers/package_tree_builder.rb
Instance Attribute Summary
Attributes inherited from Base
#id_generator, #options, #repository
Instance Method Summary collapse
Methods inherited from Base
#class_lookup, #find_assoc_by_id, #find_class_associations, #initialize, #package_diagrams, #resolve_assoc_role, #serialize_attribute
Methods included from Lutaml::Uml::ModelHelpers
#class_type_for, #extract_package_path, #format_cardinality, #format_definition, #normalize_stereotypes, #package_path_for, #parse_cardinality, #qualified_name_for
Constructor Details
This class inherits a constructor from Lutaml::UmlRepository::StaticSite::Serializers::Base
Instance Method Details
#build ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/lutaml/uml_repository/static_site/serializers/package_tree_builder.rb', line 8 def build root_packages = @repository.document.packages || @repository.packages_index.select do |pkg| pkg.namespace.nil? || !pkg.namespace.is_a?(Lutaml::Uml::Package) end if root_packages.size == 1 build_tree_node(root_packages.first) else build_virtual_root(root_packages) end end |