Sha256: dd2914ebaa425a6c56d1c4a77bc8d05f97b8d6c1297a965a57aa6016038cf4e0

Contents?: true

Size: 623 Bytes

Versions: 5

Compression:

Stored size: 623 Bytes

Contents

# frozen_string_literal: true

module Axlsx
  # The cols class manages the col object used to manage column widths.
  # This is where the magic happens with autowidth
  class Cols < SimpleTypedList
    def initialize(worksheet)
      raise ArgumentError, "you must provide a worksheet" unless worksheet.is_a?(Worksheet)

      super(Col)
      @worksheet = worksheet
    end

    # Serialize the Cols object
    # @param [String] str
    # @return [String]
    def to_xml_string(str = +'')
      return if empty?

      str << '<cols>'
      each { |item| item.to_xml_string(str) }
      str << '</cols>'
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
caxlsx-4.2.0 lib/axlsx/workbook/worksheet/cols.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/caxlsx-4.1.0/lib/axlsx/workbook/worksheet/cols.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/caxlsx-4.1.0/lib/axlsx/workbook/worksheet/cols.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/caxlsx-4.1.0/lib/axlsx/workbook/worksheet/cols.rb
caxlsx-4.1.0 lib/axlsx/workbook/worksheet/cols.rb