« PLS/Parser/Element/VariableStatement.pm
↑ Summary
PLS/Server/Request/Client/RegisterCapability.pm »
| 1 | package PLS::Server::Message; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | ▶ | use JSON::PP; |
|
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 | 0 | ▶ | my ($self) = @_; |
|
Subroutine
serialize: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 24 | |||
| 25 | my %content = ( | ||
| 26 | jsonrpc => '2.0', | ||
| 27 | 0 | %{$self} | |
| 28 | ); | ||
| 29 | |||
| 30 | 0 | my $json = encode_json \%content; | |
| 31 | 0 | return $json; | |
| 32 | } | ||
| 33 | |||
| 34 | 1 | 1; | |