line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::TypeInference::Type::Object; |
2
|
3
|
|
|
3
|
|
1440
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
73
|
|
3
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
706
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub new { |
6
|
4
|
|
|
4
|
0
|
15
|
my ($class, $properties) = @_; |
7
|
4
|
|
|
|
|
25
|
return bless { properties => $properties }, $class; |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub name { |
11
|
0
|
|
|
0
|
0
|
0
|
my ($class) = @_; |
12
|
0
|
|
|
|
|
0
|
return 'object'; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub properties { |
16
|
6
|
|
|
6
|
0
|
1409
|
my ($self) = @_; |
17
|
6
|
|
|
|
|
31
|
return $self->{properties}; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub accepts { |
21
|
17
|
|
|
17
|
0
|
1174
|
my ($class, $data) = @_; |
22
|
17
|
|
|
|
|
99
|
return ref($data) eq 'HASH'; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub signature { |
26
|
1
|
|
|
1
|
0
|
6
|
my ($self) = @_; |
27
|
1
|
|
|
|
|
1
|
my @sorted_keys = sort keys %{$self->properties}; |
|
1
|
|
|
|
|
4
|
|
28
|
1
|
|
|
|
|
3
|
my @prop_signatures = map { join ':', $_, $self->properties->{$_}->signature } @sorted_keys; |
|
2
|
|
|
|
|
6
|
|
29
|
1
|
|
|
|
|
8
|
return sprintf 'object[%s]', join ', ', @prop_signatures; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
__END__ |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=encoding utf-8 |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 NAME |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
JSON::TypeInference::Type::Object - JSON object type |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DESCRIPTION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
C< JSON::TypeInference::Type::Object > represents JSON object type. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
It is a container type, and has some type parameters on each properties. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 AUTHOR |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
aereal E<lt>aereal@aereal.orgE<gt> |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|