Class: Glossarist::ConceptDocument
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Glossarist::ConceptDocument
show all
- Defined in:
- lib/glossarist/concept_document.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.for_version(version) ⇒ Object
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/glossarist/concept_document.rb', line 23
def self.for_version(version)
case version.to_s
when "2"
require_relative "v2"
V2::ConceptDocument
else
require_relative "v3"
V3::ConceptDocument
end
end
|
.from_managed_concept(managed_concept) ⇒ Object
16
17
18
19
20
21
|
# File 'lib/glossarist/concept_document.rb', line 16
def self.from_managed_concept(managed_concept)
new(
concept: managed_concept,
localizations: managed_concept.localizations&.values || [],
)
end
|
Instance Method Details
#to_managed_concept ⇒ Object
34
35
36
37
38
|
# File 'lib/glossarist/concept_document.rb', line 34
def to_managed_concept
mc = concept
localizations.each { |l10n| mc.add_localization(l10n) }
mc
end
|