brian d foy > Brick-0.226_02 > Brick::Result::Item

Download:
Brick-0.226_02.tar.gz

Annotate this POD

CPAN RT

New  3
Open  0
View/Report Bugs
Source  

NAME ^

Brick::Result::Item - The result from a single profile element

SYNOPSIS ^

        use Brick;
        
        my $result = $brick->apply( $Profile, $Input );

        $result->explain;

DESCRIPTION ^

This class provides methods to turn the data structure returned by apply() into a useable form for particular situations.

new( HASH_REF )

Keys:

        label    - the label for the item
        
        method   - the responsible subroutine
        
        result   - 1 | 0 | undef (See set_result)
        
        messages - the error reference that comes back from the brick
get_label
set_label( STRING )

Get or set the label for the item. This is the label that the profile object used to mark the item. This joins the items in the results to the items in the profile.

get_method
set_method( STRING )

Get or set the method name responsible for the validation. When you need to track down the subroutine causing the problems, this should be it's name.

get_result
set_result( 1 | 0 | undef )

Get or set the result of the element. The result is one of three values depending on what happened:

        1     - passed
        0     - failed by validation
        undef - failed by program error
get_messages
set_messages( HASH_REF )

Get or set the message hash for the errors.

passed

Returns true if the item passed validation.

failed

Returns true if the item failed validation. This ight mean that the validation fails or that there was a programming error. See is_validation_error and is_code_error.

is_validation_error

Returns true if the failure was the result of a validation error (so not a programming error).

is_code_error

Returns true if the failure was the result of a programming error (so not a validation error). In hash from get_messages will have a key program_error with the value of 1, and the message key will have the program error message.

TO DO ^

TBA

SEE ALSO ^

Brick::Profile

SOURCE AVAILABILITY ^

This source is part of a SourceForge project which always has the latest sources in SVN, as well as all of the previous releases.

        svn co https://brian-d-foy.svn.sourceforge.net/svnroot/brian-d-foy brian-d-foy

If, for some reason, I disappear from the world, one of the other members of the project can shepherd this module appropriately.

AUTHOR ^

brian d foy, <bdfoy@cpan.org>

COPYRIGHT ^

Copyright (c) 2007, brian d foy, All Rights Reserved.

You may redistribute this under the same terms as Perl itself.

syntax highlighting: