class Prawn::Table::Cells
def index_cells
Make sure to call this before using @rows or @columns.
the object graph, the ones that are only there to be iterated over.
Cells object. Without this, we would needlessly index the leaf nodes of
Defers indexing until rows() or columns() is actually called on the
def index_cells @rows = {} @columns = {} each do |cell| @rows[cell.row] ||= [] @rows[cell.row] << cell @columns[cell.column] ||= [] @columns[cell.column] << cell end @first_row = @rows.keys.min @first_column = @columns.keys.min @row_count = @rows.size @column_count = @columns.size @indexed = true end