summaryrefslogtreecommitdiffstats
path: root/lib/MooseX/Validation/Doctypes/Errors.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MooseX/Validation/Doctypes/Errors.pm')
-rw-r--r--lib/MooseX/Validation/Doctypes/Errors.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/MooseX/Validation/Doctypes/Errors.pm b/lib/MooseX/Validation/Doctypes/Errors.pm
index 7601855..9da6f91 100644
--- a/lib/MooseX/Validation/Doctypes/Errors.pm
+++ b/lib/MooseX/Validation/Doctypes/Errors.pm
@@ -106,6 +106,14 @@ has extra_data => (
predicate => 'has_extra_data',
);
+=method TO_JSON
+
+Returns a hashref with keys of C<errors> and C<extra_data>, containing the
+values of those attributes. This allows L<JSON> to properly encode the error
+object.
+
+=cut
+
sub TO_JSON {
my $self = shift;
@@ -115,6 +123,13 @@ sub TO_JSON {
};
}
+=method stringify
+
+Returns a human-readable string containing the error data in the object. This
+is used for the stringification overload.
+
+=cut
+
sub stringify {
my $self = shift;