Class: Axlsx::Relationships
- Inherits:
-
SimpleTypedList
- Object
- SimpleTypedList
- Axlsx::Relationships
- Defined in:
- lib/axlsx/rels/relationships.rb
Overview
Note:
The package automatically manages releationships.
Relationships are a collection of Relations that define how package parts are related.
Instance Method Summary collapse
-
#initialize ⇒ Relationships
constructor
Creates a new Relationships collection based on SimpleTypedList.
-
#to_xml ⇒ String
Serializes the relationships document.
Constructor Details
#initialize ⇒ Relationships
Creates a new Relationships collection based on SimpleTypedList
9 10 11 |
# File 'lib/axlsx/rels/relationships.rb', line 9 def initialize super Relationship end |
Instance Method Details
#to_xml ⇒ String
Serializes the relationships document.
15 16 17 18 19 20 21 22 |
# File 'lib/axlsx/rels/relationships.rb', line 15 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 |