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.8.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.8.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.7.2 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.7.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.7.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb