line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Valiemon::ValidationError; |
2
|
25
|
|
|
25
|
|
78
|
use strict; |
|
25
|
|
|
|
|
26
|
|
|
25
|
|
|
|
|
525
|
|
3
|
25
|
|
|
25
|
|
72
|
use warnings; |
|
25
|
|
|
|
|
19
|
|
|
25
|
|
|
|
|
414
|
|
4
|
25
|
|
|
25
|
|
65
|
use utf8; |
|
25
|
|
|
|
|
20
|
|
|
25
|
|
|
|
|
74
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Class::Accessor::Lite ( |
7
|
25
|
|
|
|
|
133
|
ro => [qw(attribute position expected actual)], |
8
|
25
|
|
|
25
|
|
10136
|
); |
|
25
|
|
|
|
|
18943
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
378
|
|
|
378
|
0
|
2063
|
my ($class, $attr, $position) = @_; |
12
|
378
|
|
|
|
|
1280
|
return bless { |
13
|
|
|
|
|
|
|
attribute => $attr, |
14
|
|
|
|
|
|
|
position => $position, |
15
|
|
|
|
|
|
|
}, $class; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub set_detail { |
19
|
378
|
|
|
378
|
0
|
699
|
my ($self, %params) = @_; |
20
|
|
|
|
|
|
|
|
21
|
378
|
|
|
|
|
494
|
$self->{expected} = $params{expected}; |
22
|
378
|
|
|
|
|
687
|
$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; |