Class: Glossarist::NonVerbalReference

Inherits:
Lutaml::Model::Serializable
  • Object
show all
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).

Direct Known Subclasses

FigureReference, FormulaReference, TableReference

Class Method Summary collapse

Class Method Details

.of_yaml(hash) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/glossarist/non_verbal_reference.rb', line 14

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