line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Salvation::TC::Meta::Type::Maybe; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Salvation::TC::Meta::Type::Maybe - Класс для Maybe[`] типов. |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=cut |
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
16
|
use strict; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
122
|
|
10
|
4
|
|
|
4
|
|
12
|
use warnings; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
88
|
|
11
|
|
|
|
|
|
|
|
12
|
4
|
|
|
4
|
|
13
|
use base 'Salvation::TC::Meta::Type'; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
652
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 METHODS |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=cut |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head2 new() |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=cut |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
1
|
1
|
4
|
my ( $proto, %args ) = @_; |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
7
|
my $self = $proto -> SUPER::new( %args ); |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
5
|
$self -> { 'validator' } = $self -> build_validator( $self -> validator() ); |
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
|
|
7
|
return $self; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 build_validator( CodeRef $old_validator ) |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub build_validator { |
38
|
|
|
|
|
|
|
|
39
|
1
|
|
|
1
|
1
|
2
|
my ( $self, $old_validator ) = @_; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
return sub { |
42
|
|
|
|
|
|
|
|
43
|
4
|
100
|
|
4
|
|
15
|
! defined( $_[ 0 ] ) || $old_validator -> ( @_ ); |
44
|
1
|
|
|
|
|
4
|
}; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |