line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Valiemon::ValidationError; |
2
|
19
|
|
|
19
|
|
87
|
use strict; |
|
19
|
|
|
|
|
23
|
|
|
19
|
|
|
|
|
549
|
|
3
|
19
|
|
|
19
|
|
82
|
use warnings; |
|
19
|
|
|
|
|
26
|
|
|
19
|
|
|
|
|
499
|
|
4
|
19
|
|
|
19
|
|
79
|
use utf8; |
|
19
|
|
|
|
|
28
|
|
|
19
|
|
|
|
|
90
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Class::Accessor::Lite ( |
7
|
19
|
|
|
|
|
180
|
ro => [qw(attribute position expected actual)], |
8
|
19
|
|
|
19
|
|
12466
|
); |
|
19
|
|
|
|
|
23083
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
72
|
|
|
72
|
0
|
836
|
my ($class, $attr, $position) = @_; |
12
|
72
|
|
|
|
|
461
|
return bless { |
13
|
|
|
|
|
|
|
attribute => $attr, |
14
|
|
|
|
|
|
|
position => $position, |
15
|
|
|
|
|
|
|
}, $class; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub set_detail { |
19
|
72
|
|
|
72
|
0
|
260
|
my ($self, %params) = @_; |
20
|
|
|
|
|
|
|
|
21
|
72
|
|
|
|
|
233
|
$self->{expected} = $params{expected}; |
22
|
72
|
|
|
|
|
229
|
$self->{actual} = $params{actual}; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub as_message { |
26
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
27
|
0
|
|
|
|
|
|
return sprintf 'invalid `%s` at `%s`.', |
28
|
|
|
|
|
|
|
$self->attribute->attr_name, $self->position; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |