line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::TypeInference::Type::Object; |
2
|
3
|
|
|
3
|
|
1618
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
79
|
|
3
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
804
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub new { |
6
|
4
|
|
|
4
|
0
|
20
|
my ($class, $properties) = @_; |
7
|
4
|
|
|
|
|
24
|
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
|
1416
|
my ($self) = @_; |
17
|
6
|
|
|
|
|
30
|
return $self->{properties}; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub accepts { |
21
|
17
|
|
|
17
|
0
|
1607
|
my ($class, $data) = @_; |
22
|
17
|
|
|
|
|
95
|
return ref($data) eq 'HASH'; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub signature { |
26
|
1
|
|
|
1
|
0
|
5
|
my ($self) = @_; |
27
|
1
|
|
|
|
|
2
|
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
|
|
|
|
|
|
|
|