Sha256: 9d830a8d5f32291e5c593ffbc745aac143bd69f1a991e8be00e2db9832d2928f

Contents?: true

Size: 613 Bytes

Versions: 4

Compression:

Stored size: 613 Bytes

Contents

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

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

    # Parse Function object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [Function] 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

4 entries across 4 versions & 1 rubygems

Version Path
ooxml_parser-0.4.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb
ooxml_parser-0.4.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb
ooxml_parser-0.3.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb
ooxml_parser-0.2.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb