line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooX::Role::Validatable::Error; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
15754
|
use Moo; |
|
2
|
|
|
|
|
12103
|
|
|
2
|
|
|
|
|
14
|
|
4
|
2
|
|
|
2
|
|
2900
|
use Types::Standard qw( Str Int Bool ); |
|
2
|
|
|
|
|
126025
|
|
|
2
|
|
|
|
|
31
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has message => ( |
7
|
|
|
|
|
|
|
is => 'ro', |
8
|
|
|
|
|
|
|
required => 1, |
9
|
|
|
|
|
|
|
); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has message_to_client => ( |
12
|
|
|
|
|
|
|
is => 'ro', |
13
|
|
|
|
|
|
|
required => 1, |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has set_by => ( |
17
|
|
|
|
|
|
|
is => 'ro', |
18
|
|
|
|
|
|
|
required => 1, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has severity => ( |
22
|
|
|
|
|
|
|
is => 'ro', |
23
|
|
|
|
|
|
|
isa => Int, |
24
|
|
|
|
|
|
|
default => sub { 1 }, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
has transient => ( |
28
|
|
|
|
|
|
|
is => 'ro', |
29
|
|
|
|
|
|
|
isa => Bool, |
30
|
|
|
|
|
|
|
default => sub { 0 }, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
has alert => ( |
34
|
|
|
|
|
|
|
is => 'ro', |
35
|
|
|
|
|
|
|
isa => Bool, |
36
|
|
|
|
|
|
|
default => sub { 0 }, |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
has info_link => (is => 'ro'); |
40
|
|
|
|
|
|
|
has info_text => (is => 'ro'); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub as_html { |
43
|
2
|
|
|
2
|
0
|
3372
|
my $self = shift; |
44
|
|
|
|
|
|
|
|
45
|
2
|
|
|
|
|
10
|
my $html = " " . $self->message_to_client; |
46
|
2
|
50
|
|
|
|
10
|
if (my $info_link = $self->info_link) { |
47
|
2
|
|
50
|
|
|
12
|
my $info_text = $self->info_text || 'More Info...'; |
48
|
2
|
|
|
|
|
8
|
$html .= qq~$info_text\n~; |
49
|
|
|
|
|
|
|
} |
50
|
2
|
|
|
|
|
3
|
$html .= "\n"; |
51
|
|
|
|
|
|
|
|
52
|
2
|
|
|
|
|
17
|
return $html; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
2
|
|
|
2
|
|
2536
|
no Moo; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
18
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
__END__ |