Sha256: 1fb3134ea2177726be96db0d00cf8a4715641ff399b35f144b2f381a3a0100d3

Contents?: true

Size: 889 Bytes

Versions: 45

Compression:

Stored size: 889 Bytes

Contents

# frozen_string_literal: true

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

    # Parse PreSubSuperscript
    # @param [Nokogiri::XML:Node] node with PreSubSuperscript
    # @return [PreSubSuperscript] result of parsing
    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

45 entries across 45 versions & 1 rubygems

Version Path
ooxml_parser-0.37.1 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.37.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.36.1 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.36.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.35.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.34.2 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.34.1 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.34.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.33.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.32.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.31.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.30.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.29.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.28.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.27.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.26.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.25.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.24.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.23.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.22.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb