class Axlsx::Cols

The cols class manages the col object used to manage column widths. This is where the magic happens with autowidth

Public Class Methods

new(worksheet) click to toggle source
Calls superclass method Axlsx::SimpleTypedList::new
# File lib/axlsx/workbook/worksheet/cols.rb, line 7
def initialize(worksheet)
  raise ArgumentError, "you must provide a worksheet" unless worksheet.is_a?(Worksheet)
  super Col
  @worksheet = worksheet
end

Public Instance Methods

to_xml_string(str = '') click to toggle source
# File lib/axlsx/workbook/worksheet/cols.rb, line 13
def to_xml_string(str = '')
 return if empty?
 str << '<cols>'
 each { |item| item.to_xml_string(str) }
 str << '</cols>' 
end