Sha256: 2d9c94d2ddc8f51ef5352e3bb45447209a3626d6ecfa6be6e1abea08b93c45d7

Contents?: true

Size: 639 Bytes

Versions: 3

Compression:

Stored size: 639 Bytes

Contents

# frozen_string_literal: true

module OoxmlParser
  # Class for parsing `w:CommentRangeStart` tags
  class CommentRangeStart < OOXMLDocumentObject
    # @return [Integer] id of bookmark
    attr_reader :id

    # Parse CommentRangeStart object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [CommentRangeStart] result of parsing
    def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'id'
          @id = value.value.to_i
        end
      end
      self
    end

    def comment
      root_object.comments.comments_array.detect { |comment| comment.id == id }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ooxml_parser-0.6.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/comment_range_start.rb
ooxml_parser-0.5.1 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/comment_range_start.rb
ooxml_parser-0.5.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/comment_range_start.rb