Method: RubyXL::OOXMLObjectInstanceMethods#before_write_xml
- Defined in:
- lib/rubyXL/objects/ooxml_object.rb
permalink #before_write_xml ⇒ Object
Subclass provided filter to perform last-minute operations (cleanup, count, etc.) immediately prior to write, along with option to terminate the actual write if false
is returned (for example, to avoid writing the collection’s root node if the collection is empty).
357 358 359 360 361 362 363 364 |
# File 'lib/rubyXL/objects/ooxml_object.rb', line 357 def before_write_xml #TODO# This will go away once containers are fully implemented. child_nodes = obtain_class_variable(:@@ooxml_child_nodes) child_nodes.each_pair { |_child_node_name, child_node_params| self.count = self.send(child_node_params[:accessor]).size if child_node_params[:is_array] == :with_count } true end |