Sha256: 7cbe292f71a3a20229fbc30c81ec2a04ff99ae9cb2183bc96e5eaa35a7aead83

Contents?: true

Size: 745 Bytes

Versions: 3

Compression:

Stored size: 745 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

    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

3 entries across 3 versions & 1 rubygems

Version Path
ooxml_parser-0.6.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.5.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb
ooxml_parser-0.5.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/pre_sub_superscript.rb