Sha256: e9d2b5a6396a639790ab65b514679a5f680b41133aff9035443c593552118c90

Contents?: true

Size: 642 Bytes

Versions: 8

Compression:

Stored size: 642 Bytes

Contents

# frozen_string_literal: true

module OoxmlParser
  # Class for `rad` data
  class Radical < OOXMLDocumentObject
    attr_accessor :degree, :value

    def initialize(parent: nil)
      @degree = 2
      @parent = parent
    end

    # Parse Radical object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [Radical] result of parsing
    def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'deg'
          @degree = DocxFormula.new(parent: self).parse(node_child)
        end
      end
      @value = DocxFormula.new(parent: self).parse(node)
      self
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ooxml_parser-0.8.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb
ooxml_parser-0.8.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb
ooxml_parser-0.7.2 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb
ooxml_parser-0.7.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb
ooxml_parser-0.7.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb
ooxml_parser-0.6.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb
ooxml_parser-0.5.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb
ooxml_parser-0.5.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb