Method: Axlsx::Workbook#insert_worksheet
- Defined in:
- lib/axlsx/workbook/workbook.rb
#insert_worksheet(index = 0, options = {}) {|worksheet| ... } ⇒ Worksheet
inserts a worksheet into this workbook at the position specified. It the index specified is out of range, the worksheet will be added to the end of the worksheets collection
246 247 248 249 250 251 252 |
# File 'lib/axlsx/workbook/workbook.rb', line 246 def insert_worksheet(index=0, ={}) worksheet = Worksheet.new(self, ) @worksheets.delete_at(@worksheets.size - 1) @worksheets.insert(index, worksheet) yield worksheet if block_given? worksheet end |