Sha256: 0c1ecfafff6bd2142fedc79acb192e6487d0c0afe257d925d2cebe630d3a7052

Contents?: true

Size: 1.55 KB

Versions: 29

Compression:

Stored size: 1.55 KB

Contents

require 'rubyXL/objects/ooxml_object'
require 'rubyXL/objects/extensions'

module RubyXL

  # http://www.datypic.com/sc/ooxml/e-ssml_comment-1.html
  class Comment < OOXMLObject
    define_child_node(RubyXL::RichText, :node_name => 'text')
    define_child_node(RubyXL::AlternateContent)
    define_attribute(:ref,      :ref, :required => true)
    define_attribute(:authorId, :int, :required => true)
    define_attribute(:guid,     :string)
    define_element_name 'comment'
  end

  # http://www.datypic.com/sc/ooxml/e-ssml_authors-1.html
  class CommentList < OOXMLContainerObject
    define_child_node(RubyXL::Comment, :collection => [0..-1])
    define_element_name 'commentList'
  end

  # http://www.datypic.com/sc/ooxml/e-ssml_authors-1.html
  class Authors < OOXMLContainerObject
    define_child_node(RubyXL::StringNode, :node_name => :author, :collection => [0..-1])
    define_element_name 'authors'
  end

  # http://www.datypic.com/sc/ooxml/e-ssml_comments.html
  class CommentsFile < OOXMLTopLevelObject
    CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml'
    REL_TYPE     = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments'

    define_child_node(RubyXL::Authors)
    define_child_node(RubyXL::CommentList)
    define_child_node(RubyXL::ExtensionStorageArea)
    define_element_name 'comments'
    set_namespaces('http://schemas.openxmlformats.org/spreadsheetml/2006/main' => nil)

    attr_accessor :workbook

    def xlsx_path
      ROOT.join('xl', "comments#{file_index}.xml")
    end

  end

end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
rubyXL-3.4.23 lib/rubyXL/objects/comments.rb
rubyXL-3.4.22 lib/rubyXL/objects/comments.rb
rubyXL-3.4.21 lib/rubyXL/objects/comments.rb
rubyXL-3.4.20 lib/rubyXL/objects/comments.rb
rubyXL-3.4.18 lib/rubyXL/objects/comments.rb
rubyXL-3.4.17 lib/rubyXL/objects/comments.rb
rubyXL-3.4.16 lib/rubyXL/objects/comments.rb
rubyXL-3.4.15 lib/rubyXL/objects/comments.rb
rubyXL-3.4.14 lib/rubyXL/objects/comments.rb
rubyXL-3.4.12 lib/rubyXL/objects/comments.rb
rubyXL-3.4.11 lib/rubyXL/objects/comments.rb
rubyXL-3.4.10 lib/rubyXL/objects/comments.rb
rubyXL-3.4.9 lib/rubyXL/objects/comments.rb
rubyXL-3.4.8 lib/rubyXL/objects/comments.rb
rubyXL-3.4.6 lib/rubyXL/objects/comments.rb
rubyXL-3.4.5 lib/rubyXL/objects/comments.rb
rubyXL-3.4.4 lib/rubyXL/objects/comments.rb
rubyXL-3.4.3 lib/rubyXL/objects/comments.rb
rubyXL-3.4.2 lib/rubyXL/objects/comments.rb
rubyXL-3.4.1 lib/rubyXL/objects/comments.rb