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
254 255 256 257 258 259 260 |
# File 'lib/axlsx/workbook/workbook.rb', line 254 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 |