Module Kernel
In: lib/ruport/data/grouping.rb
lib/ruport/data/table.rb

Methods

Group   Grouping   Table  

Public Instance methods

Shortcut interface for creating Data::Group

Example:

  g = Group('mygroup', :data => [[1,2,3],[4,5,6]],
        :column_names => %w[a b c])   #=> creates a new group named mygroup

Shortcut interface for creating Data::Grouping

Example:

  a = [[1,2,3],[4,5,6]].to_table(%w[a b c])
  b = Grouping(a, :by => "a")   #=> creates a new grouping on column "a"

Shortcut interface for creating Data::Tables

Examples:

  t = Table(%w[a b c])   #=> creates a new empty table w. cols a,b,c
  t = Table("a","b","c") #=> creates a new empty table w. cols a,b,c

  # allows building table inside of block, returns table object
  t = Table(%w[a b c]) { |t| t << [1,2,3] }

  # allows loading table from CSV
  # accepts all Data::Table.load options, including block (yields table,row)

  t = Table("foo.csv")
  t = Table("bar.csv", :has_names => false)

[Validate]