JSON::RPC::Legacy::Procedure - JSON-RPC Service attributes
package MyApp; use base ('JSON::RPC::Legacy::Procedure'); sub sum : Public { my ($s, @arg) = @_; return $arg[0] + $arg[1]; } # or sub sum : Public(a, b) { my ($s, $obj) = @_; return $obj->{a} + $obj->{b}; } # or sub sum : Number(a:num, b:num) { my ($s, $obj) = @_; return $obj->{a} + $obj->{b}; } # private method can't be called by clients sub _foobar : Private { # ... }
Using this module, you can write a subroutine with a special attribute.
Currently, in below attributes, only Public and Private are available. Others are same as Public.
Means that a client can call this procedure.
Means that a client can't call this procedure.
Means that its return values is an array object.
Means that its return values is a member object.
Means that a return values is a true or false.
true
false
Means that its return values is a number.
Means that its return values is a string.
Means that its return values is a null.
null
http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html
Makamaka Hannyaharamitu, <makamaka[at]cpan.org>
Copyright 2007 by Makamaka Hannyaharamitu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install JSON::RPC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JSON::RPC
CPAN shell
perl -MCPAN -e shell install JSON::RPC
For more information on module installation, please visit the detailed CPAN module installation guide.