Sha256: 3297eed608d4c13384d5f4cf6d02e13cec89b9096a3612a9f6c44e0644b6b58c

Contents?: true

Size: 948 Bytes

Versions: 11

Compression:

Stored size: 948 Bytes

Contents

# frozen_string_literal: true

require_relative 'presentation_comments/presentation_comment'
module OoxmlParser
  # Class for parsing `comment1.xml` file
  class PresentationComments < OOXMLDocumentObject
    # @return [Array<PresentationComment>] list of comments
    attr_reader :list

    def initialize(parent: nil)
      @list = []
      super
    end

    # Parse PresentationComments object
    # @param file [Nokogiri::XML:Element] node to parse
    # @return [PresentationComments] result of parsing
    def parse(file = "#{root_object.unpacked_folder}/#{root_object.root_subfolder}/comments/comment1.xml")
      return nil unless File.exist?(file)

      document = parse_xml(file)
      node = document.xpath('*').first

      node.xpath('*').each do |node_child|
        case node_child.name
        when 'cm'
          @list << PresentationComment.new(parent: self).parse(node_child)
        end
      end
      self
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ooxml_parser-0.37.1 lib/ooxml_parser/pptx_parser/presentation/presentation_comments.rb
ooxml_parser-0.37.0 lib/ooxml_parser/pptx_parser/presentation/presentation_comments.rb
ooxml_parser-0.36.1 lib/ooxml_parser/pptx_parser/presentation/presentation_comments.rb
ooxml_parser-0.36.0 lib/ooxml_parser/pptx_parser/presentation/presentation_comments.rb
ooxml_parser-0.35.0 lib/ooxml_parser/pptx_parser/presentation/presentation_comments.rb
ooxml_parser-0.34.2 lib/ooxml_parser/pptx_parser/presentation/presentation_comments.rb
ooxml_parser-0.34.1 lib/ooxml_parser/pptx_parser/presentation/presentation_comments.rb
ooxml_parser-0.34.0 lib/ooxml_parser/pptx_parser/presentation/presentation_comments.rb
ooxml_parser-0.33.0 lib/ooxml_parser/pptx_parser/presentation/presentation_comments.rb
ooxml_parser-0.32.0 lib/ooxml_parser/pptx_parser/presentation/presentation_comments.rb
ooxml_parser-0.31.0 lib/ooxml_parser/pptx_parser/presentation/presentation_comments.rb