Sha256: 421d54e3c3059f1d171c51d0db07fbe6d9e2c03724b9482d83327d41b30c9d7b

Contents?: true

Size: 738 Bytes

Versions: 49

Compression:

Stored size: 738 Bytes

Contents

# frozen_string_literal: true

require_relative 'math_run/math_run_properties'
module OoxmlParser
  # Class for parsing `m:r` object
  class MathRun < OOXMLDocumentObject
    # @return [MathRunProperties] properties of run
    attr_accessor :properties
    # @return [String] text of formula
    attr_accessor :text

    # Parse MathRun
    # @param [Nokogiri::XML:Node] node with MathRun
    # @return [MathRun] result of parsing
    def parse(node)
      node.xpath('*').each do |math_run_child|
        case math_run_child.name
        when 'rPr'
          @properties = MathRunProperties.new(parent: self).parse(math_run_child)
        when 't'
          @text = math_run_child.text
        end
      end
      self
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
ooxml_parser-0.22.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.21.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.20.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.19.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.18.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.18.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.17.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.16.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.15.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.14.2 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.14.1-mingw32 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.14.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.14.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.13.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.12.2 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.12.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.12.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.11.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.10.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb
ooxml_parser-0.9.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run.rb