Class: Lutaml::UmlRepository::StaticSite::DataTransformer
- Inherits:
-
Object
- Object
- Lutaml::UmlRepository::StaticSite::DataTransformer
- Defined in:
- lib/lutaml/uml_repository/static_site/data_transformer.rb
Overview
Transforms a UmlRepository into a normalized JSON data structure optimized for client-side navigation and search.
The output follows a normalized structure with:
-
Flat maps for packages, classes, attributes, associations
-
References by stable IDs
-
Hierarchical package tree for navigation
Instance Attribute Summary collapse
-
#id_generator ⇒ Object
readonly
Returns the value of attribute id_generator.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
Instance Method Summary collapse
-
#initialize(repository, options = {}) ⇒ DataTransformer
constructor
Initialize transformer.
-
#transform ⇒ Hash
Transform repository to JSON structure.
Constructor Details
#initialize(repository, options = {}) ⇒ DataTransformer
Initialize transformer
information as markdown
31 32 33 34 35 36 |
# File 'lib/lutaml/uml_repository/static_site/data_transformer.rb', line 31 def initialize(repository, = {}) @repository = repository @options = .merge() @id_generator = IDGenerator.new @generalization_map = build_generalization_map end |
Instance Attribute Details
#id_generator ⇒ Object (readonly)
Returns the value of attribute id_generator.
21 22 23 |
# File 'lib/lutaml/uml_repository/static_site/data_transformer.rb', line 21 def id_generator @id_generator end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
21 22 23 |
# File 'lib/lutaml/uml_repository/static_site/data_transformer.rb', line 21 def @options end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
21 22 23 |
# File 'lib/lutaml/uml_repository/static_site/data_transformer.rb', line 21 def repository @repository end |
Instance Method Details
#transform ⇒ Hash
Transform repository to JSON structure
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/lutaml/uml_repository/static_site/data_transformer.rb', line 41 def transform { metadata: , packageTree: build_package_tree, packages: build_packages_map, classes: build_classes_map, attributes: build_attributes_map, associations: build_associations_map, operations: build_operations_map, diagrams: (@options[:include_diagrams] ? build_diagrams_map : {}), } end |