line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::DynamicValidator::Error; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Data::DynamicValidator::Error::VERSION = '0.03'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
# ABSTRACT: Class holds validation error: reason and location |
6
|
|
|
|
|
|
|
|
7
|
8
|
|
|
8
|
|
49040
|
use strict; |
|
8
|
|
|
|
|
22
|
|
|
8
|
|
|
|
|
391
|
|
8
|
8
|
|
|
8
|
|
120
|
use warnings; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
541
|
|
9
|
|
|
|
|
|
|
|
10
|
8
|
|
|
8
|
|
14952
|
use overload fallback => 1, q/""/ => sub { $_[0]->to_string }; |
|
8
|
|
|
1
|
|
9289
|
|
|
8
|
|
|
|
|
250
|
|
|
1
|
|
|
|
|
393
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
6
|
|
|
6
|
0
|
11
|
my ($class, $reason, $path) = @_; |
14
|
6
|
|
|
|
|
20
|
my $self = { |
15
|
|
|
|
|
|
|
_reason => $reason, |
16
|
|
|
|
|
|
|
_path => $path, |
17
|
|
|
|
|
|
|
}; |
18
|
6
|
|
|
|
|
34
|
bless $self => $class; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
1
|
5
|
sub to_string{ $_[0]->{_reason} }; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
3
|
|
|
3
|
1
|
432
|
sub reason { $_[0]->{_reason} }; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
0
|
1
|
|
sub path { $_[0]->{_path} } |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__END__ |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=pod |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=encoding UTF-8 |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 NAME |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Data::DynamicValidator::Error - Class holds validation error: reason and location |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 VERSION |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
version 0.03 |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 METHODS |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 to_string |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Stringizes to reason by default |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head2 reason |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Returns the human-readable error description |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 path |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Returns the path object, pointing to the error location |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 AUTHOR |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Ivan Baidakou <dmol@gmx.com> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This software is copyright (c) 2014 by Ivan Baidakou. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
70
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |