Module: RubyXL::RelationshipSupport
- Included in:
- ChartFile, Chartsheet, DrawingFile, Workbook, WorkbookRoot, Worksheet
- Defined in:
- lib/rubyXL/objects/relationships.rb
Instance Attribute Summary collapse
-
#generic_storage ⇒ Object
Returns the value of attribute generic_storage.
-
#relationship_container ⇒ Object
Returns the value of attribute relationship_container.
Instance Method Summary collapse
- #collect_related_objects ⇒ Object
- #load_relationships(dir_path, base_file_name = '') ⇒ Object
-
#related_objects ⇒ Object
Override this method.
- #store_relationship(related_file, unknown = false) ⇒ Object
Instance Attribute Details
#generic_storage ⇒ Object
Returns the value of attribute generic_storage.
179 180 181 |
# File 'lib/rubyXL/objects/relationships.rb', line 179 def generic_storage @generic_storage end |
#relationship_container ⇒ Object
Returns the value of attribute relationship_container.
179 180 181 |
# File 'lib/rubyXL/objects/relationships.rb', line 179 def relationship_container @relationship_container end |
Instance Method Details
#collect_related_objects ⇒ Object
184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/rubyXL/objects/relationships.rb', line 184 def res = .compact # Avoid tainting +related_objects+ array res += generic_storage if generic_storage if relationship_container then relationship_container.owner = self res << relationship_container end res.each { |o| res += o. if o.respond_to?(:collect_related_objects) } res end |
#load_relationships(dir_path, base_file_name = '') ⇒ Object
205 206 207 208 209 210 211 212 |
# File 'lib/rubyXL/objects/relationships.rb', line 205 def load_relationships(dir_path, base_file_name = '') self.relationship_container = relationship_file_class.load_relationship_file(dir_path, base_file_name) return if relationship_container.nil? relationship_container.(dir_path, base_file_name).each_pair { |rid, | attach_relationship(rid, ) if } end |
#related_objects ⇒ Object
Override this method
180 181 182 |
# File 'lib/rubyXL/objects/relationships.rb', line 180 def # Override this method [] end |
#store_relationship(related_file, unknown = false) ⇒ Object
199 200 201 202 203 |
# File 'lib/rubyXL/objects/relationships.rb', line 199 def store_relationship(, unknown = false) self.generic_storage ||= [] puts "WARNING: #{self.class} is not aware what to do with #{related_file.class}" if unknown self.generic_storage << end |