Class: Mxrb::Compiler::SystemTextMaterializer
- Inherits:
-
Object
- Object
- Mxrb::Compiler::SystemTextMaterializer
- Includes:
- ModelValues
- Defined in:
- lib/mxrb/compiler/system_text_materializer.rb
Overview
Stores the Runtime system-text index; localized values live in i18n properties.
Instance Method Summary collapse
-
#initialize(mpr_path, deployment:) ⇒ SystemTextMaterializer
constructor
A new instance of SystemTextMaterializer.
- #materialize ⇒ Object
Constructor Details
#initialize(mpr_path, deployment:) ⇒ SystemTextMaterializer
Returns a new instance of SystemTextMaterializer.
11 12 13 14 |
# File 'lib/mxrb/compiler/system_text_materializer.rb', line 11 def initialize(mpr_path, deployment:) @mpr_path = File.(mpr_path) @deployment = File.(deployment) end |
Instance Method Details
#materialize ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/mxrb/compiler/system_text_materializer.rb', line 16 def materialize source = SourceModel.read(@mpr_path).units_of('Texts$SystemTextCollection').first document = source ? compile(source.document) : empty_collection path = File.join(@deployment, 'model', 'model.mdp') ModelPackage.read(path).upsert(document).write(path) SystemTextMaterialization.new(model_path: path, texts: document.fetch('SystemTexts').length) end |