Method: Axlsx::TableStyles#to_xml

Defined in:
lib/axlsx/stylesheet/table_styles.rb

#to_xml(xml) ⇒ String

Serializes the table styles element

Parameters:

  • xml (Nokogiri::XML::Builder)

    The document builder instance this objects xml will be added to.

Returns:

  • (String)


30
31
32
33
34
35
36
# File 'lib/axlsx/stylesheet/table_styles.rb', line 30

def to_xml(xml)
  attr = self.instance_values.reject {|k, v| ![:defaultTableStyle, :defaultPivotStyle].include?(k.to_sym) }
  attr[:count] = self.size
  xml.tableStyles(attr) {
    self.each { |table_style| table_style.to_xml(xml) }
  }
end