Class: Glossarist::V3::ManagedConceptData

Inherits:
ManagedConceptData
  • Object
show all
Defined in:
lib/glossarist/v3/managed_concept_data.rb

Overview

V3 ManagedConceptData — the data payload inside a V3::ManagedConcept.

V3 placement rule (MECE): related lives ONLY on V3::ManagedConcept, not on its data payload. V2 placed related inside data; the V2→V3 migration (SchemaMigration::V2ToV3) moves it to the concept level. Keeping related writable on V3 data would re-open the trap where writing to data.related bypasses ManagedConcept.detect_schema_version (which keys off concept.related).

The base class Glossarist::ManagedConceptData still declares related for V1/V2 compatibility; V3 overrides that with an empty attribute via attribute :related, nil so the slot is inert and serializes nothing.

Instance Method Summary collapse

Instance Method Details

#localizations_from_yaml(model, value) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/glossarist/v3/managed_concept_data.rb', line 38

def localizations_from_yaml(model, value)
  value.each do |localized_concept_hash|
    localized_concept = V3::LocalizedConcept.of_yaml(localized_concept_hash)
    model.localizations.store(localized_concept.language_code,
                              localized_concept)
  end
end

#localizations_to_yaml(model, doc) ⇒ Object



46
# File 'lib/glossarist/v3/managed_concept_data.rb', line 46

def localizations_to_yaml(model, doc); end