Method: RubyXL::OOXMLRelationshipsFile#before_write_xml

Defined in:
lib/rubyXL/objects/relationships.rb

#before_write_xmlObject

[View source]

115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/rubyXL/objects/relationships.rb', line 115

def before_write_xml
  case owner
  when RubyXL::WorkbookRoot, RubyXL::Workbook then
    # Fully implemented objects with no generic (unhandled) relationships -
    #   (re)generating relationships from scratch.
    related_objects = owner.related_objects
    related_objects += owner.generic_storage if owner.generic_storage

    self.relationships = []
    related_objects.compact.each { |f| add_relationship(f) }
  end
  super
end