line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geo::JSON::Role::ToJson; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.006'; # VERSION |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# ABSTRACT: Moo::Role providing to_json() methods for a geojson object |
6
|
|
|
|
|
|
|
|
7
|
7
|
|
|
7
|
|
79229
|
use Moo::Role; |
|
7
|
|
|
|
|
20
|
|
|
7
|
|
|
|
|
55
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub to_json { |
11
|
42
|
|
|
42
|
1
|
43295
|
my $self = shift; |
12
|
42
|
|
33
|
|
|
205
|
my $codec = shift || $Geo::JSON::json; |
13
|
42
|
|
|
|
|
378
|
return $codec->encode($self); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# used by JSON 'convert_blessed' |
17
|
|
|
|
|
|
|
sub TO_JSON { |
18
|
22
|
|
|
22
|
0
|
60
|
return { type => $_[0]->type, %{ $_[0] } }; |
|
22
|
|
|
|
|
269
|
|
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
1; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
__END__ |