The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Data::Tabular::Group::Interface - Object that is passed into group_by methods

SYNOPSIS

   group_by => {
       groups => [
          {
             pre => sub {
                  my $self = shift;    # This is a Data::Tabular::Group::Interface object
             },
          }
       ],
    },

DESCRIPTION

Data::Tabular::Group::Interface is only used by the group_by function of the Data::Tabular package.

There are several 2 major groups of methods in this object: access methods and output methods. Access methods let the users groups methods access information about the current table and the output methods that return the rows that are being inserted into the table.

Constructor

new()

The user should never need to call the constructor.

Access Methods

get([column name])

This method returns the value of the column given by column name. This column should be a grouped column or the value will unpredictable (one of the values from the group).

count

This give the number of input rows in the current group.

Output Methods

header(text => 'header text')

The header method returns a header row that will span the complete table.

Arguments

text

The text that is printed in the header. Often get() and count() are used to build this string.

titles

The titles method returns a row of titles. Normally all tables will use this method at least once.

totals/sum

This method return a row with the columns listed in the sum array summed.

averages/avg

This is similar to the totals method, but each value is divided by the number of input rows before being output.

AUTHOR

"G. Allen Morris III" <gam3@gam3.net>