Class: Latexmath::Model::MathSymbol

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/latexmath/model.rb,
lib/latexmath/model/nodes.rb

Overview

A catalog capture (+symbols+, unicode_symbols): the spelling the grammar matched. Its Unicode value and kind are derived from the spelling through the symbol table (lib/latexmath/model.rb).

Instance Method Summary collapse

Instance Method Details

#entry ⇒ Object

The Symbols::Entry for #spelling, looked up from its spelling, stripped, as in the legacy transform.



44
45
46
# File 'lib/latexmath/model.rb', line 44

def entry
  Latexmath::Symbols.resolve(spelling.to_s)
end

#kind ⇒ Object



38
39
40
# File 'lib/latexmath/model.rb', line 38

def kind
  @kind = symbol_kind
end

#symbol_kind ⇒ Object

"symbol", "open" or "close".



54
55
56
# File 'lib/latexmath/model.rb', line 54

def symbol_kind
  spelling && entry.kind
end

#symbol_value ⇒ Object

The Unicode text the symbol stands for.



49
50
51
# File 'lib/latexmath/model.rb', line 49

def symbol_value
  spelling && entry.value
end

#value ⇒ Object

Keep the Ruby convenience readers live while the portable schema carries ordinary typed values. Reads do not change default tracking.



34
35
36
# File 'lib/latexmath/model.rb', line 34

def value
  @value = symbol_value
end