Method: Axlsx::Worksheet#initialize
- Defined in:
- lib/axlsx/workbook/worksheet/worksheet.rb
#initialize(wb, options = {}) ⇒ Worksheet
Note:
the recommended way to manage worksheets is Workbook#add_worksheet
Creates a new worksheet.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 97 def initialize(wb, ={}) self.workbook = wb @workbook.worksheets << self @drawing = @page_margins = @auto_filter = nil @merged_cells = [] @auto_fit_data = [] @conditional_formattings = [] @selected = false @show_gridlines = true self.name = "Sheet" + (index+1).to_s @page_margins = PageMargins.new [:page_margins] if [:page_margins] @rows = SimpleTypedList.new Row @column_info = SimpleTypedList.new Col # @cols = SimpleTypedList.new Cell @tables = SimpleTypedList.new Table .each do |o| self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" end end |