Class: Plurimath::Mathml::Parser
- Inherits:
-
Object
- Object
- Plurimath::Mathml::Parser
- Defined in:
- lib/plurimath/mathml/parser.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(text) ⇒ Parser
Returns a new instance of Parser.
8 9 10 |
# File 'lib/plurimath/mathml/parser.rb', line 8 def initialize(text) @text = text end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
6 7 8 |
# File 'lib/plurimath/mathml/parser.rb', line 6 def text @text end |
Instance Method Details
#parse ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/plurimath/mathml/parser.rb', line 12 def parse mml_tree = Mml.parse( text, version: 4, namespace_exist: namespace_exist?, ) Mathml::Translator.new.mml_to_plurimath(mml_tree) end |