1JSON::RPC::Legacy::ProcUesdeurreC(o3n)tributed Perl DocuJmSeOnNt:a:tRiPoCn::Legacy::Procedure(3)
2
3
4

NAME

6       JSON::RPC::Legacy::Procedure - JSON-RPC Service attributes
7

SYNOPSIS

9        package MyApp;
10
11        use base ('JSON::RPC::Legacy::Procedure');
12
13        sub sum : Public {
14            my ($s, @arg) = @_;
15            return $arg[0] + $arg[1];
16        }
17
18        # or
19
20        sub sum : Public(a, b) {
21            my ($s, $obj) = @_;
22            return $obj->{a} + $obj->{b};
23        }
24
25        # or
26
27        sub sum : Number(a:num, b:num) {
28            my ($s, $obj) = @_;
29            return $obj->{a} + $obj->{b};
30        }
31
32        # private method can't be called by clients
33
34        sub _foobar : Private {
35            # ...
36        }
37

DESCRIPTION

39       Using this module, you can write a subroutine with a special attribute.
40
41       Currently, in below attributes, only Public and Private are available.
42       Others are same as Public.
43
44       Public
45           Means that a client can call this procedure.
46
47       Private
48           Means that a client can't call this procedure.
49
50       Arr Means that its return values is an array object.
51
52       Obj Means that its return values is a member object.
53
54       Bit
55       Bool
56           Means that a return values is a "true" or "false".
57
58       Num Means that its return values is a number.
59
60       Str Means that its return values is a string.
61
62       Nil
63       None
64           Means that its return values is a "null".
65

TODO

67       Auto Service Description
68       Type check
69

SEE ALSO

71       <http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html>
72

AUTHOR

74       Makamaka Hannyaharamitu, <makamaka[at]cpan.org>
75
77       Copyright 2007 by Makamaka Hannyaharamitu
78
79       This library is free software; you can redistribute it and/or modify it
80       under the same terms as Perl itself.
81
82
83
84perl v5.36.0                      2022-07-22   JSON::RPC::Legacy::Procedure(3)
Impressum