Class: Glossarist::NonVerbalReference
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Glossarist::NonVerbalReference
- Includes:
- Reference
- Defined in:
- lib/glossarist/non_verbal_reference.rb
Overview
Abstract base for references to dataset-level non-verbal entities.
FigureReference, TableReference, and FormulaReference all carry an
entity ID and an optional display override. They are produced both by
structural arrays (figures: [id] on ManagedConceptData) and by inline
mentions ({{fig:id}} in text).
Includes the Reference protocol so mixed-collection validation rules can iterate these alongside ConceptReference / BibliographicReference / AssetReference without type-checking. All predicates default to false.
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Reference
Class Method Details
.of_yaml(hash) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/glossarist/non_verbal_reference.rb', line 20 def self.of_yaml(hash) return new(entity_id: hash) if hash.is_a?(String) new( entity_id: hash["ref"] || hash["id"] || hash[:ref] || hash[:id], display: hash["display"] || hash[:display], ) end |
Instance Method Details
#dedup_key ⇒ Object
29 30 31 |
# File 'lib/glossarist/non_verbal_reference.rb', line 29 def dedup_key [self.class.name, entity_id] end |