File Coverage

lib/UR/Value/JSON.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 18 18 100.0


line stmt bran cond sub pod time code
1             package UR::Value::JSON;
2              
3 1     1   25 use strict;
  1         2  
  1         28  
4 1     1   4 use warnings;
  1         1  
  1         27  
5              
6 1     1   7 use JSON;
  1         1  
  1         6  
7              
8             class UR::Value::JSON {
9             is => 'UR::Value',
10             };
11              
12             my $_JS_CODEC = new JSON->allow_nonref;
13              
14             sub __serialize_id__ {
15 6     6   7 shift;
16 6         97 return $_JS_CODEC->canonical->encode(@_);
17             }
18              
19             sub __deserialize_id__ {
20 3     3   3 shift;
21 3         29 return $_JS_CODEC->decode(@_);
22             }
23              
24             1;