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   2754 use warnings;
  9         10  
  9         189  
4 9     9   28  
  9         10  
  9         146  
5             use PLS::JSON;
6 9     9   74  
  9         19  
  9         825  
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 114 my %content = (
25             jsonrpc => '2.0',
26             %{$self}
27             );
28 38         78  
  38         262  
29             my $json = encode_json \%content;
30             return \$json;
31 38         434 } ## end sub serialize
32 38         118  
33             1;