line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::TypeInference::Type::Object; |
2
|
3
|
|
|
3
|
|
1458
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
75
|
|
3
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
722
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub new { |
6
|
3
|
|
|
3
|
0
|
15
|
my ($class, $properties) = @_; |
7
|
3
|
|
|
|
|
18
|
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
|
5
|
|
|
5
|
0
|
1019
|
my ($self) = @_; |
17
|
5
|
|
|
|
|
26
|
return $self->{properties}; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub accepts { |
21
|
16
|
|
|
16
|
0
|
1148
|
my ($class, $data) = @_; |
22
|
16
|
|
|
|
|
86
|
return ref($data) eq 'HASH'; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub signature { |
26
|
1
|
|
|
1
|
0
|
5
|
my ($self) = @_; |
27
|
1
|
|
|
|
|
3
|
my @sorted_keys = sort keys %{$self->properties}; |
|
1
|
|
|
|
|
3
|
|
28
|
1
|
|
|
|
|
3
|
my @prop_signatures = map { join ':', $_, $self->properties->{$_}->signature } @sorted_keys; |
|
2
|
|
|
|
|
6
|
|
29
|
1
|
|
|
|
|
7
|
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
|
|
|
|
|
|
|
|