Method: Axlsx.sort_cells

Defined in:
lib/axlsx.rb

.sort_cells(cells) ⇒ Array

sorts the array of cells provided to start from the minimum x,y to the maximum x.y#

Parameters:

  • cells (Array)

Returns:

  • (Array)


67
68
69
# File 'lib/axlsx.rb', line 67

def self.sort_cells(cells)
  cells.sort { |x, y| [x.index, x.row.index] <=> [y.index, y.row.index] }
end