Dave Rolsky > Chloro > Chloro::Result::Group

Download:
Chloro-0.06.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.06   Source  

NAME ^

Chloro::Result::Group - A result for a single group

VERSION ^

version 0.06

SYNOPSIS ^

    my $group_result = $resultset->result_for('group');

    for my $field_result ( $group_result->results() ) {
        print $field_result->field()->name() . ' = ' . $field_result->value();
    }

DESCRIPTION ^

This class represents the result for a single repetition of a group after processing user-submitted data.

A group result is like a miniature Chloro::ResultSet object, and shares some methods with that class, because it contains the results for more than one field.

METHODS ^

This class has the following methods:

Chloro::Result::Group->new()

The constructor accepts the following arguments:

$result->results()

Returns a list of Chloro::Result::Field objects for the fields associated with this repetition of the group.

$result->result_for('field')

Given a field name, returns the Chloro::Result::Field object for that field. Note that for this API, you can simply pass the field's name without a group prefix.

$result->key()

Returns the key associated with this group result.

$result->prefix()

Returns the field prefix for this group result.

$result->is_valid()

This returns true if none of the fields in this group's result have any errors.

$result->key_value_pairs()

Returns the result as a key/value pair, where the keys are field names (without prefixes).

ROLES ^

This class does the Chloro::Role::Result and Chloro::Role::ResultSet role.

AUTHOR ^

Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2011 by Dave Rolsky.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)
syntax highlighting: