Class: Lutaml::UmlRepository::PackageExporter
- Inherits:
-
Object
- Object
- Lutaml::UmlRepository::PackageExporter
- Defined in:
- lib/lutaml/uml_repository/package_exporter.rb
Overview
PackageExporter handles exporting UmlRepository instances to LUR (LutaML UML Repository) package files.
LUR packages are ZIP archives containing:
-
Serialized Document model
-
Serialized indexes for fast loading
-
Metadata about the package
-
Statistics about the model
Instance Attribute Summary collapse
-
#metadata ⇒ PackageMetadata
readonly
The package metadata.
-
#options ⇒ Hash
readonly
Export options.
-
#repository ⇒ UmlRepository
readonly
The repository being exported.
Instance Method Summary collapse
-
#export(output_path) ⇒ void
Export the repository to a LUR package file.
-
#initialize(repository, options = {}) ⇒ PackageExporter
constructor
Initialize a new PackageExporter.
Constructor Details
#initialize(repository, options = {}) ⇒ PackageExporter
Initialize a new PackageExporter.
66 67 68 69 70 |
# File 'lib/lutaml/uml_repository/package_exporter.rb', line 66 def initialize(repository, = {}) @repository = repository @options = .merge() @metadata = (@options) end |
Instance Attribute Details
#metadata ⇒ PackageMetadata (readonly)
Returns The package metadata.
48 49 50 |
# File 'lib/lutaml/uml_repository/package_exporter.rb', line 48 def @metadata end |
#options ⇒ Hash (readonly)
Returns Export options.
45 46 47 |
# File 'lib/lutaml/uml_repository/package_exporter.rb', line 45 def @options end |
#repository ⇒ UmlRepository (readonly)
Returns The repository being exported.
42 43 44 |
# File 'lib/lutaml/uml_repository/package_exporter.rb', line 42 def repository @repository end |
Instance Method Details
#export(output_path) ⇒ void
This method returns an undefined value.
Export the repository to a LUR package file.
79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/lutaml/uml_repository/package_exporter.rb', line 79 def export(output_path) Zip::File.open(output_path, create: true) do |zip| (zip) write_document(zip) write_indexes(zip) write_index_tree(zip) write_statistics(zip) end end |