Method: Spreadsheet::Worksheet#replace_row

Defined in:
lib/spreadsheet/worksheet.rb

#replace_row(idx, *cells) ⇒ Object

Replace the Row at idx with the following arguments. Like #update_row, but truncates the Row if there are fewer arguments than Cells in the Row.



280
281
282
283
284
285
# File 'lib/spreadsheet/worksheet.rb', line 280

def replace_row idx, *cells
  if (row = @rows[idx]) && cells.size < row.size
    cells.concat Array.new(row.size - cells.size)
  end
  update_row idx, *cells
end