| 1 | package PLS::Server::Message; | ||
| 2 | |||
| 3 | 9 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 9 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 9 | ▶ | use PLS::JSON; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | PLS::Server::Message | ||
| 11 | |||
| 12 | =head1 DESCRIPTION | ||
| 13 | |||
| 14 | This class is the abstract base class for all messages sent between | ||
| 15 | server and client. | ||
| 16 | |||
| 17 | See L<PLS::Server::Request> and L<PLS::Server::Response>, which | ||
| 18 | inherit from this class. | ||
| 19 | |||
| 20 | =cut | ||
| 21 | |||
| 22 | sub serialize | ||
| 23 | { | ||
| 24 | 31 | ▶ | my ($self) = @_; |
|
Subroutine
serialize: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 25 | |||
| 26 | my %content = ( | ||
| 27 | jsonrpc => '2.0', | ||
| 28 | 31 | %{$self} | |
| 29 | ); | ||
| 30 | |||
| 31 | 31 | my $json = encode_json \%content; | |
| 32 | 31 | return \$json; | |
| 33 | } ## end sub serialize | ||
| 34 | |||
| 35 | 9 | 1; | |