Class: Axlsx::ColBreaks
- Inherits:
-
SimpleTypedList
- Object
- SimpleTypedList
- Axlsx::ColBreaks
- Defined in:
- lib/axlsx/workbook/worksheet/col_breaks.rb
Overview
A collection of Brake objects. Please do not use this class directly. Instead use Worksheet#add_break
Instance Method Summary collapse
-
#add_break(options) ⇒ Object
A column break specific helper for adding a break.
-
#initialize ⇒ ColBreaks
constructor
Instantiates a new list restricted to Break types.
-
#to_xml_string(str = '') ⇒ Object
Serialize the collection to xml
Constructor Details
Instance Method Details
#add_break(options) ⇒ Object
A column break specific helper for adding a break. The max and man options are fixed, however any other valid option for Break will be passed to the created break object.
18 19 20 21 |
# File 'lib/axlsx/workbook/worksheet/col_breaks.rb', line 18 def add_break() @list << Break.new(.merge(:max => 1048575, :man => true)) last end |
#to_xml_string(str = '') ⇒ Object
Serialize the collection to xml
28 29 30 31 32 33 |
# File 'lib/axlsx/workbook/worksheet/col_breaks.rb', line 28 def to_xml_string(str='') return if empty? str << '<colBreaks count="' << @list.size.to_s << '" manualBreakCount="' << @list.size.to_s << '">' each { |brk| brk.to_xml_string(str) } str << '</colBreaks>' end |