Take me over?
NAME
Chloro::Result::Field - A result for a single field
VERSION
version 0.01
SYNOPSIS
my
$result
=
$resultset
->result_for(
'field'
);
$result
->field()->name() .
' = '
.
$result
->value();
DESCRIPTION
This class represents the result for a single field after processing user-submitted data.
METHODS
This class has the following methods:
Chloro::Result::Field->new()
The constructor accepts the following arguments:
errors
An array reference of Chloro::Error::Field objects. This is required, but can be an empty reference.
field
The Chloro::Field object for this result.
value
The value for the result. This can be any data type.
$result->errors()
Returns a list of Chloro::Error::Field objects for this result.
$result->is_valid()
Returns true if there are no errors associated with this result.
$result->field()
Returns the Chloro::Field object for this result.
$result->value()
Returns the value for this field. This can be any data type, undef, non-reference, reference, object, etc.
$result->key_value_pairs()
Returns the result as a key/value pair, where the key is the field name. This is plural so that this class and the Chloro::Result::Group class can share an API.
ROLES
This class does the Chloro::Role::Result 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)