Sha256: 0234b4d7c544a05a6e0586e327cd9f1556b985a69c491a09ac51ce8dbd0e4e74

Contents?: true

Size: 717 Bytes

Versions: 15

Compression:

Stored size: 717 Bytes

Contents

module Axlsx
require 'axlsx/rels/relationship.rb'

  # Relationships are a collection of Relations that define how package parts are related.
  # @note The package automatically manages releationships.
  class Relationships < SimpleTypedList

    # Creates a new Relationships collection based on SimpleTypedList
    def initialize
      super Relationship
    end

    # Serializes the relationships document.
    # @return [String]
    def to_xml()
      builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
        xml.Relationships(:xmlns => Axlsx::RELS_R) {
          each_with_index { |rel, index| rel.to_xml(xml, "rId#{index+1}") }
        }
      end
      builder.to_xml
    end
  
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
axlsx-1.0.15 lib/axlsx/rels/relationships.rb
axlsx-1.0.14 lib/axlsx/rels/relationships.rb
axlsx-1.0.13 lib/axlsx/rels/relationships.rb
axlsx-1.0.11 lib/axlsx/rels/relationships.rb
axlsx-1.0.10 lib/axlsx/rels/relationships.rb
axlsx-1.0.10a lib/axlsx/rels/relationships.rb
axlsx-1.0.9 lib/axlsx/rels/relationships.rb
axlsx-1.0.8 lib/axlsx/rels/relationships.rb
axlsx-1.0.7 lib/axlsx/rels/relationships.rb
axlsx-1.0.6 lib/axlsx/rels/relationships.rb
axlsx-1.0.5 lib/axlsx/rels/relationships.rb
axlsx-1.0.4 lib/axlsx/rels/relationships.rb
axlsx-1.0.3 lib/axlsx/rels/relationships.rb
axlsx-1.0.1 lib/axlsx/rels/relationships.rb
axlsx-1.0.0 lib/axlsx/rels/relationships.rb