class OoxmlParser::MathRun

Class for parsing ‘m:r` object

Attributes

properties[RW]

@return [MathRunProperties] properties of run

text[RW]

@return [String] text of formula

Public Instance Methods

parse(node) click to toggle source

Parse MathRun @param [Nokogiri::XML:Node] node with MathRun @return [MathRun] result of parsing

# File lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/math_run.rb, line 15
def parse(node)
  node.xpath('*').each do |math_run_child|
    case math_run_child.name
    when 'rPr'
      @properties = MathRunProperties.new(parent: self).parse(math_run_child)
    when 't'
      @text = math_run_child.text
    end
  end
  self
end