summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook/worksheet/col_breaks.rb
blob: 2bf927e1bfc68a5010f872c393edbc830b8e28a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module Axlsx

  class ColBreaks < SimpleTypedList

    def initialize
      super Break
    end

    def add_break(options)
      options.merge max: 1048575, man: true
      @list << Break.new(options)
    end

    def to_xml_string(str='')
      return if empty?
      str << '<colBreaks count="' << @list.size << '" manualBreakCount="' << @list.size << '">'
      each { |brk| brk.to_xml_string(str) }
      str << '</rowBreaks>'
    end
  end
end