class OoxmlParser::Nary

Class for parsing ‘m:nary` object

Attributes

bottom_value[RW]

@return [DocxFormula] bottom_value

properties[RW]

@return [NaryProperties] properties of nary

top_value[RW]

@return [DocxFormula] top value

Public Instance Methods

parse(node) click to toggle source

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

# File lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/nary.rb, line 19
def parse(node)
  node.xpath('*').each do |nary_child_node|
    case nary_child_node.name
    when 'sub'
      @bottom_value = DocxFormula.new(parent: self).parse(nary_child_node)
    when 'sup'
      @top_value = DocxFormula.new(parent: self).parse(nary_child_node)
    when 'naryPr'
      @properties = NaryProperties.new(parent: self).parse(nary_child_node)
    end
  end
  self
end