Module: Kernel

Defined in:
lib/ruport/data/grouping.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) Group(name, opts = {})

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


396
397
398
# File 'lib/ruport/data/grouping.rb', line 396

def Group(name,opts={})
  Ruport::Data::Group.new(opts.merge(:name => name))  
end

- (Object) Grouping(*args)

Shortcut interface for creating Data::Grouping

Example:

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


385
386
387
# File 'lib/ruport/data/grouping.rb', line 385

def Grouping(*args)
  Ruport::Data::Grouping.new(*args)
end