Class: Plurimath::Omml::Utility
Overview
Omml-specific helper extracted from Plurimath::Utility (code-quality
refactor). Subclasses Utility so bareword Utility.<generic> calls inside
Omml files keep resolving here and inherit the generic helpers.
Class Method Summary
collapse
contextual_accent_from_token
Class Method Details
.populate_function_classes(mrow = []) ⇒ Object
33
34
35
36
37
38
39
|
# File 'lib/plurimath/omml/utility.rb', line 33
def populate_function_classes(mrow = [])
flatten_mrow = mrow.flatten.compact
unary_function_classes(flatten_mrow)
binary_function_classes(flatten_mrow)
ternary_function_classes(flatten_mrow)
flatten_mrow
end
|
.resolve_symbol_token(value) ⇒ Object
26
27
28
29
30
31
|
# File 'lib/plurimath/omml/utility.rb', line 26
def resolve_symbol_token(value)
return nil if value.nil?
function_from_token(value) ||
symbols_class(string_to_html_entity(value.to_s), lang: :omml)
end
|
.resolve_text_token(value) ⇒ Object
20
21
22
23
24
|
# File 'lib/plurimath/omml/utility.rb', line 20
def resolve_text_token(value)
return nil if value.nil?
function_from_token(value) || text_token(value)
end
|
.valid_class(object) ⇒ Object