Method: DataTable::Table#group_data!

Defined in:
lib/data-table/table.rb

#group_data!Object



182
183
184
185
186
187
188
189
# File 'lib/data-table/table.rb', line 182

def group_data!
  @groupings.compact!
  @collection = if @groupings.count > 1
                  collection.group_by_recursive(@groupings)
                else
                  collection.group_by { |row| row[@groupings.first] }
                end
end