Class | Ruport::Data::Group |
In: |
lib/ruport/data/grouping.rb
|
Parent: | Table |
name | [R] | The name of the group |
subgroups | [R] | A hash of subgroups |
Creates a new Group based on the supplied options.
Valid options:
:name: | The name of the Group |
:data: | An Array of Arrays representing the records in this Group |
:column_names: | An Array containing the column names for this Group. |
Example:
group = Group.new :name => 'My Group', :data => [[1,2,3], [3,4,5]], :column_names => %w[a b c]
Creates subgroups for the group based on the supplied column name. Each subgroup is a hash whose keys are the unique values in the column.
Example:
main_group = Group.new :name => 'test', :data => [[1,2,3,4,5], [3,4,5,6,7]], :column_names => %w[a b c d e] main_group.create_subgroups("a")