NAME

Valiant::Error - A single error encountered during validation.

SYNOPSIS

    This won't be used standalone.  Its always a collection of Error objects
    inside the Valiant::Errors module.

DESCRIPTION

A Single Error.

This is generally an internal class and you are unlikely to use it directly. For the most part its used by Valiant::Errors.

ATTRIBUTES

This class defines the following attributes

type

Either a translation tag or text string of the error

attribute

The attribute which is associated with the error or undef if the error is for the model

METHODS

This class exposes the following methods for public users.

match ($attribute, $type, $options)

Returns true of the error matches (has the same parameters) as the arguments passed. This differs from "strict_match" in that $options don't need to be completely identical; it must ony be the case that the $options passed in the arguments intersects with that actual options of the error (that is the error has to have everything in $options BUT it can have more things.

strict_match ($attribute, $type, $options)

Same as "match" except <$options> must exactly match and not just intersect.

equals ($error)

Returna a boolean based on if $error is functionally equal. By this it is meant that it has the same attribute values (not that it is the same error instance).

This includes options matching.

clone

Create a new copy of the error.

SEE ALSO

Valiant, Valiant::Errors.

AUTHOR

See Valiant

COPYRIGHT & LICENSE

See Valiant