Sha256: ad3e9a832bb844e621420e3b5b7246230ad4333d59a5f6de81eafb96d32351e0

Contents?: true

Size: 934 Bytes

Versions: 1

Compression:

Stored size: 934 Bytes

Contents

module OoxmlParser
  # Class for `d` data
  class Delimiter < OOXMLDocumentObject
    attr_accessor :begin_character, :value, :end_character

    def initialize(parent: nil)
      @begin_character = '('
      @end_character = ')'
      @parent = parent
    end

    # Parse Delimiter object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [Delimiter] result of parsing
    def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'dPr'
          node_child.xpath('*').each do |node_child_child|
            case node_child_child.name
            when 'begChr'
              @begin_character = node_child_child.attribute('val').value
            when 'endChr'
              @end_character = node_child_child.attribute('val').value
            end
          end
        end
      end
      @value = DocxFormula.new(parent: self).parse(node)
      self
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ooxml_parser-0.2.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/delimeter.rb