Class: Ea::Sources::Qea::MetadataBuilder
- Inherits:
-
Object
- Object
- Ea::Sources::Qea::MetadataBuilder
- Defined in:
- lib/ea/sources/qea/metadata_builder.rb
Overview
Builds an Ea::Model::Metadata from the QEA database. Pulls project-level info (model name, version, tool, source path) from the root package and the QEA file path.
Instance Attribute Summary collapse
-
#database ⇒ Object
readonly
Returns the value of attribute database.
-
#qea_path ⇒ Object
readonly
Returns the value of attribute qea_path.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(database, qea_path) ⇒ MetadataBuilder
constructor
A new instance of MetadataBuilder.
Constructor Details
#initialize(database, qea_path) ⇒ MetadataBuilder
Returns a new instance of MetadataBuilder.
12 13 14 15 |
# File 'lib/ea/sources/qea/metadata_builder.rb', line 12 def initialize(database, qea_path) @database = database @qea_path = qea_path end |
Instance Attribute Details
#database ⇒ Object (readonly)
Returns the value of attribute database.
10 11 12 |
# File 'lib/ea/sources/qea/metadata_builder.rb', line 10 def database @database end |
#qea_path ⇒ Object (readonly)
Returns the value of attribute qea_path.
10 11 12 |
# File 'lib/ea/sources/qea/metadata_builder.rb', line 10 def qea_path @qea_path end |
Instance Method Details
#build ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ea/sources/qea/metadata_builder.rb', line 17 def build root_pkg = root_package Ea::Model::Metadata.new( id: "metadata", title: root_pkg&.name, version: root_pkg&.version, created_date: root_pkg&.createddate, modified_date: root_pkg&.modifieddate, author: root_pkg&.pkgowner, source_format: "qea", source_tool: "Sparx Enterprise Architect", source_path: qea_path ) end |