line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Bubblegum Wrapper around JSON Serialization |
2
|
|
|
|
|
|
|
package Bubblegum::Wrapper::Json; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
326
|
use 5.10.0; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
5
|
1
|
|
|
1
|
|
438
|
use namespace::autoclean; |
|
1
|
|
|
|
|
13731
|
|
|
1
|
|
|
|
|
5
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
369
|
use Bubblegum::Class; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use Class::Load 'load_class'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
extends 'Bubblegum::Object::Instance'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.40'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub decode { |
15
|
|
|
|
|
|
|
my $self = shift; |
16
|
|
|
|
|
|
|
my $json = load_class('JSON::Tiny', {-version => 0.45})->new; |
17
|
|
|
|
|
|
|
return $json->decode($self->data); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub encode { |
21
|
|
|
|
|
|
|
my $self = shift; |
22
|
|
|
|
|
|
|
my $json = load_class('JSON::Tiny', {-version => 0.45})->new; |
23
|
|
|
|
|
|
|
return $json->encode($self->data); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |