File Coverage

blib/lib/Event/RPC/Message/JSON.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 0 2 0.0
total 20 22 90.9


line stmt bran cond sub pod time code
1             # $Id: Message.pm,v 1.9 2014-01-28 15:40:10 joern Exp $
2              
3             #-----------------------------------------------------------------------
4             # Copyright (C) 2005-2015 by Jörn Reder .
5             # All Rights Reserved. See file COPYRIGHT for details.
6             #
7             # This module is part of Event::RPC, which is free software; you can
8             # redistribute it and/or modify it under the same terms as Perl itself.
9             #-----------------------------------------------------------------------
10              
11             package Event::RPC::Message::JSON;
12              
13 21     21   112 use base Event::RPC::Message::SerialiserBase;
  21         42  
  21         1617  
14              
15 21     21   112 use strict;
  21         30  
  21         329  
16 21     21   74 use utf8;
  21         40  
  21         87  
17              
18 21     21   11582 use JSON::XS 3.0;
  21         47923  
  21         2355  
19              
20             my $decoder = JSON::XS->new->allow_tags;
21             my $encoder = JSON::XS->new->latin1->allow_blessed->allow_tags;
22              
23 156     156 0 7635 sub decode_message { $decoder->decode($_[1]) }
24 156     156 0 3235 sub encode_message { $encoder->encode($_[1]) }
25              
26             1;
27              
28             __END__