Sha256: 168f7508c2214e06b826ac97c5f45f957420c4c4c8eda21dd34498c764556d35

Contents?: true

Size: 714 Bytes

Versions: 4

Compression:

Stored size: 714 Bytes

Contents

module OoxmlParser
  # Class for parsing `m:sPre` object
  class PreSubSuperscript < OOXMLDocumentObject
    # @return [DocxFormula] top value
    attr_accessor :top_value

    # @return [DocxFormula] bottom_value
    attr_accessor :bottom_value

    # @return [DocxFormula] base
    attr_accessor :base

    def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'sub'
          @bottom_value = DocxFormula.new(parent: self).parse(node_child)
        when 'sup'
          @top_value = DocxFormula.new(parent: self).parse(node_child)
        when 'e'
          @base = DocxFormula.new(parent: self).parse(node_child)
        end
      end
      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/pre_sub_superscript.rb
ooxml_parser-0.4.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.3.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.2.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb