line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::TypeInference::Type::Array; |
2
|
3
|
|
|
3
|
|
28430
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
205
|
|
3
|
3
|
|
|
3
|
|
19
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
645
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub new { |
6
|
4
|
|
|
4
|
0
|
52
|
my ($class, $element_type) = @_; |
7
|
4
|
|
|
|
|
23
|
return bless { element_type => $element_type }, $class; |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub name { |
11
|
1
|
|
|
1
|
0
|
3
|
my ($class) = @_; |
12
|
1
|
|
|
|
|
4
|
return 'array'; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub element_type { |
17
|
4
|
|
|
4
|
0
|
5312
|
my ($self) = @_; |
18
|
4
|
|
|
|
|
22
|
return $self->{element_type}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub signature { |
22
|
1
|
|
|
1
|
0
|
5
|
my ($self) = @_; |
23
|
1
|
|
|
|
|
4
|
return sprintf 'array[%s]', $self->element_type->signature; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub accepts { |
27
|
47
|
|
|
47
|
0
|
1821
|
my ($class, $data) = @_; |
28
|
47
|
|
|
|
|
170
|
return ref($data) eq 'ARRAY'; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
__END__ |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=encoding utf-8 |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 NAME |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
JSON::TypeInference::Type::Array - JSON array type |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 DESCRIPTION |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
JSON::TypeInference::Type::Array represents JSON array type. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
It is a container type, and has a type parameter that called C<< element_type >>. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 AUTHOR |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
aereal E<lt>aereal@aereal.orgE<gt> |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=cut |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|