class Axlsx::Relationships
Relationships
are a collection of Relations that define how package parts are related. @note The package automatically manages releationships.
Public Class Methods
new()
click to toggle source
Creates a new Relationships
collection based on SimpleTypedList
Calls superclass method
# File lib/axlsx/rels/relationships.rb, line 10 def initialize super Relationship end
Public Instance Methods
for(source_obj)
click to toggle source
The relationship instance for the given source object, or nil if none exists. @see Relationship#source_obj
@return [Relationship]
# File lib/axlsx/rels/relationships.rb, line 17 def for(source_obj) find{ |rel| rel.source_obj == source_obj } end
to_xml_string(str = '')
click to toggle source
serialize relationships @param [String] str @return [String]
# File lib/axlsx/rels/relationships.rb, line 24 def to_xml_string(str = '') str << '<?xml version="1.0" encoding="UTF-8"?>' str << ('<Relationships xmlns="' << RELS_R << '">') each{ |rel| rel.to_xml_string(str) } str << '</Relationships>' end