File Coverage

blib/lib/JSON/XS/Sugar.pm
Criterion Covered Total %
statement 25 25 100.0
branch 2 2 100.0
condition n/a
subroutine 9 9 100.0
pod 1 1 100.0
total 37 37 100.0


line stmt bran cond sub pod time code
1             package JSON::XS::Sugar;
2 2     2   29950 use base qw(Exporter);
  2         3  
  2         148  
3              
4             # ABSTRACT: sugar for using JSON::XS
5              
6             # right now the XS won't work on anything before this
7 2     2   32 use 5.014000;
  2         4  
  2         39  
8              
9 2     2   6 use warnings;
  2         1  
  2         56  
10 2     2   6 use strict;
  2         3  
  2         120  
11              
12 2     2   922 use Devel::CallChecker 0.003 ();
  2         2547  
  2         38  
13 2     2   1089 use Types::Serialiser;
  2         5816  
  2         84  
14              
15             our $VERSION = '1.01';
16              
17             our @EXPORT_OK;
18              
19 2     2   10 use constant JSON_TRUE => Types::Serialiser::true;
  2         2  
  2         5  
20             push @EXPORT_OK, qw(JSON_TRUE);
21              
22 2     2   184 use constant JSON_FALSE => Types::Serialiser::false;
  2         2  
  2         4  
23             push @EXPORT_OK, qw(JSON_FALSE);
24              
25             ## no critic (Subroutines::ProhibitSubroutinePrototypes)
26              
27             sub json_truth($) {
28 4 100   4 1 1473 return $_[0] ? JSON_TRUE : JSON_FALSE;
29             }
30             push @EXPORT_OK, qw(json_truth);
31              
32             push @EXPORT_OK, qw(
33             json_number
34             json_string
35             );
36              
37             # load json_number, json_string from XS
38             require XSLoader;
39             XSLoader::load( __PACKAGE__, $VERSION );
40              
41             1;
42              
43             __END__