Sha256: bfb3aee9614e10974191f70ce6dc69b9800f1444f0fff9d7a281ae7ceae4dcba

Contents?: true

Size: 657 Bytes

Versions: 4

Compression:

Stored size: 657 Bytes

Contents

module OoxmlParser
  # Class for 'sSubSup', 'sSup', 'sSub' data
  class Index < OOXMLDocumentObject
    attr_accessor :value, :top_index, :bottom_index

    # Parse Index object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [Index] result of parsing
    def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'sup'
          @top_index = DocxFormula.new(parent: self).parse(node_child)
        when 'sub'
          @bottom_index = DocxFormula.new(parent: self).parse(node_child)
        end
      end
      @value = DocxFormula.new(parent: self).parse(node)
      self
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ooxml_parser-0.4.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/index.rb
ooxml_parser-0.4.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/index.rb
ooxml_parser-0.3.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/index.rb
ooxml_parser-0.2.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/index.rb