Class: Lutaml::UmlRepository::StaticSite::DataTransformer

Inherits:
Object
  • Object
show all
Includes:
Lutaml::Uml::ModelHelpers, AssociationSerialization
Defined in:
lib/lutaml/uml_repository/static_site/data_transformer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Lutaml::Uml::ModelHelpers

#class_type_for, #format_cardinality, #normalize_stereotypes, #package_path_for, #parse_cardinality, #qualified_name_for

Constructor Details

#initialize(repository, options = {}) ⇒ DataTransformer

Returns a new instance of DataTransformer.



26
27
28
29
30
31
# File 'lib/lutaml/uml_repository/static_site/data_transformer.rb', line 26

def initialize(repository, options = {})
  @repository = repository
  @options = default_options.merge(options)
  @id_generator = IDGenerator.new
  @generalization_map = build_generalization_map
end

Instance Attribute Details

#id_generatorObject (readonly)

Returns the value of attribute id_generator.



24
25
26
# File 'lib/lutaml/uml_repository/static_site/data_transformer.rb', line 24

def id_generator
  @id_generator
end

#optionsObject (readonly)

Returns the value of attribute options.



24
25
26
# File 'lib/lutaml/uml_repository/static_site/data_transformer.rb', line 24

def options
  @options
end

#repositoryObject (readonly)

Returns the value of attribute repository.



24
25
26
# File 'lib/lutaml/uml_repository/static_site/data_transformer.rb', line 24

def repository
  @repository
end

Instance Method Details

#transformObject



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/lutaml/uml_repository/static_site/data_transformer.rb', line 33

def transform
  Models::SpaDocument.new(
    metadata: Serializers::MetadataBuilder.new(repository).build,
    package_tree: build_package_tree,
    packages: build_packages_map,
    classes: build_classes_map,
    attributes: build_attributes_map,
    associations: build_associations_map,
    operations: build_operations_map,
    diagrams: build_diagrams_map,
  )
end