line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
17
|
use v5.12.0; |
|
1
|
|
|
|
|
6
|
|
2
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
3
|
|
|
|
|
|
|
package Data::Rx::CoreType::all 0.200008; |
4
|
|
|
|
|
|
|
# ABSTRACT: the Rx //all type |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use parent 'Data::Rx::CoreType'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
38
|
use Scalar::Util (); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
461
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub guts_from_arg { |
11
|
5
|
|
|
5
|
0
|
13
|
my ($class, $arg, $rx, $type) = @_; |
12
|
|
|
|
|
|
|
|
13
|
5
|
100
|
|
|
|
30
|
Carp::croak("unknown arguments to new") |
14
|
|
|
|
|
|
|
unless Data::Rx::Util->_x_subset_keys_y($arg, { of => 1}); |
15
|
|
|
|
|
|
|
|
16
|
4
|
100
|
|
|
|
267
|
Carp::croak("no 'of' parameter given to //all") unless exists $arg->{of}; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
|
|
14
|
my $of = $arg->{of}; |
19
|
|
|
|
|
|
|
|
20
|
3
|
100
|
33
|
|
|
166
|
Carp::croak("invalid 'of' argument to //all") unless |
|
|
|
66
|
|
|
|
|
21
|
|
|
|
|
|
|
defined $of and Scalar::Util::reftype $of eq 'ARRAY' and @$of; |
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
|
|
8
|
return { of => [ map {; $rx->make_schema($_) } @$of ] }; |
|
4
|
|
|
|
|
14
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub assert_valid { |
27
|
53
|
|
|
53
|
0
|
3240
|
my ($self, $value) = @_; |
28
|
|
|
|
|
|
|
|
29
|
53
|
|
|
|
|
75
|
my @subchecks; |
30
|
53
|
|
|
|
|
76
|
for my $i (0 .. $#{ $self->{of} }) { |
|
53
|
|
|
|
|
170
|
|
31
|
|
|
|
|
|
|
push @subchecks, [ |
32
|
|
|
|
|
|
|
$value, |
33
|
106
|
|
|
|
|
428
|
$self->{of}[$i], |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
check_path => [ [ 'of', 'key'], [ $i, 'index' ] ], |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
]; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
53
|
|
|
|
|
199
|
$self->perform_subchecks(\@subchecks); |
41
|
|
|
|
|
|
|
|
42
|
2
|
|
|
|
|
9
|
return 1; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
70
|
|
|
70
|
0
|
491
|
sub subname { 'all' } |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |