line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Valiemon::ValidationError; |
2
|
25
|
|
|
25
|
|
182
|
use strict; |
|
25
|
|
|
|
|
52
|
|
|
25
|
|
|
|
|
759
|
|
3
|
25
|
|
|
25
|
|
127
|
use warnings; |
|
25
|
|
|
|
|
53
|
|
|
25
|
|
|
|
|
688
|
|
4
|
25
|
|
|
25
|
|
152
|
use utf8; |
|
25
|
|
|
|
|
52
|
|
|
25
|
|
|
|
|
150
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Class::Accessor::Lite ( |
7
|
25
|
|
|
|
|
192
|
ro => [qw(attribute position expected actual)], |
8
|
25
|
|
|
25
|
|
12559
|
); |
|
25
|
|
|
|
|
30163
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
380
|
|
|
380
|
0
|
3363
|
my ($class, $attr, $position) = @_; |
12
|
380
|
|
|
|
|
1696
|
return bless { |
13
|
|
|
|
|
|
|
attribute => $attr, |
14
|
|
|
|
|
|
|
position => $position, |
15
|
|
|
|
|
|
|
}, $class; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub set_detail { |
19
|
380
|
|
|
380
|
0
|
1154
|
my ($self, %params) = @_; |
20
|
|
|
|
|
|
|
|
21
|
380
|
|
|
|
|
832
|
$self->{expected} = $params{expected}; |
22
|
380
|
|
|
|
|
1025
|
$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; |