File Coverage

blib/lib/PLS/Server/Message.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 18 19 94.7


line stmt bran cond sub pod time code
1              
2             use strict;
3 9     9   3274 use warnings;
  9         18  
  9         206  
4 9     9   37  
  9         18  
  9         162  
5             use PLS::JSON;
6 9     9   36  
  9         10  
  9         1139  
7             =head1 NAME
8              
9             PLS::Server::Message
10              
11             =head1 DESCRIPTION
12              
13             This class is the abstract base class for all messages sent between
14             server and client.
15              
16             See L<PLS::Server::Request> and L<PLS::Server::Response>, which
17             inherit from this class.
18              
19             =cut
20              
21             {
22             my ($self) = @_;
23              
24 38     38 0 130 my %content = (
25             jsonrpc => '2.0',
26             %{$self}
27             );
28 38         85  
  38         301  
29             my $json = encode_json \%content;
30             return \$json;
31 38         500 } ## end sub serialize
32 38         158  
33             1;