Class: Plurimath::Mathml::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/plurimath/mathml/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Parser

Returns a new instance of Parser.



50
51
52
# File 'lib/plurimath/mathml/parser.rb', line 50

def initialize(text)
  @text = text
end

Instance Attribute Details

#textObject

Returns the value of attribute text.



48
49
50
# File 'lib/plurimath/mathml/parser.rb', line 48

def text
  @text
end

Instance Method Details

#parseObject



54
55
56
57
# File 'lib/plurimath/mathml/parser.rb', line 54

def parse
  namespace_exist = text.split(">").first.include?(" xmlns=")
  ::Mml.parse(text, namespace_exist: namespace_exist)
end