Class: RubyXL::WorkbookRelationships
- Inherits:
-
OOXMLRelationshipsFile
- Object
- OOXMLObject
- OOXMLTopLevelObject
- OOXMLRelationshipsFile
- RubyXL::WorkbookRelationships
- Defined in:
- lib/rubyXL/objects/relationships.rb
Instance Attribute Summary collapse
-
#workbook ⇒ Object
Returns the value of attribute workbook.
Attributes inherited from OOXMLRelationshipsFile
Instance Method Summary collapse
Methods inherited from OOXMLRelationshipsFile
#find_by_rid, #find_by_target, get_class_by_rel_type, #load_related_files, load_relationship_file, save_order, #xlsx_path
Methods inherited from OOXMLTopLevelObject
#add_to_zip, #file_index, parse_file, save_order, set_namespaces, #xlsx_path
Methods included from OOXMLObjectClassMethods
#define_attribute, #define_child_node, #define_element_name, #obtain_class_variable, #parse, #set_countable
Methods included from OOXMLObjectInstanceMethods
#dup, #index_in_collection, #initialize, #write_xml
Instance Attribute Details
#workbook ⇒ Object
Returns the value of attribute workbook.
118 119 120 |
# File 'lib/rubyXL/objects/relationships.rb', line 118 def workbook @workbook end |
Instance Method Details
#before_write_xml ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/rubyXL/objects/relationships.rb', line 120 def before_write_xml self.relationships = [] @workbook.worksheets.each_with_index { |sheet, i| relationships << new_relationship(sheet.xlsx_path.gsub(/\Axl\//, ''), sheet.class::REL_TYPE) } # @workbook.external_links.each_key { |k| # relationships << new_relationship("externalLinks/#{k}", 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink') # } relationships << new_relationship('theme/theme1.xml', @workbook.theme.class::REL_TYPE) if @workbook.theme relationships << new_relationship('styles.xml', @workbook.stylesheet.class::REL_TYPE) if @workbook.stylesheet if @workbook.shared_strings_container && !@workbook.shared_strings_container.strings.empty? then relationships << new_relationship('sharedStrings.xml', @workbook.shared_strings_container.class::REL_TYPE) end if @workbook.calculation_chain && !@workbook.calculation_chain.cells.empty? then relationships << new_relationship('calcChain.xml', @workbook.calculation_chain.class::REL_TYPE) end true end |