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