diff options
Diffstat (limited to 'lib/axlsx/workbook/worksheet/col_breaks.rb')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/col_breaks.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/axlsx/workbook/worksheet/col_breaks.rb b/lib/axlsx/workbook/worksheet/col_breaks.rb new file mode 100644 index 00000000..2bf927e1 --- /dev/null +++ b/lib/axlsx/workbook/worksheet/col_breaks.rb @@ -0,0 +1,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 |
