1JSON::RPC::Common::ProcUesdeurreC:o:nRtertiubrunt(e3d)PJeSrOlN:D:oRcPuCm:e:nCtoamtmioonn::Procedure::Return(3)
2
3
4

NAME

6       JSON::RPC::Common::Procedure::Return - JSON-RPC procedure return class
7

SYNOPSIS

9               use JSON::RPC::Common::Procedure::Return;
10
11               # create a return from a call, retaining the ID
12               my $return = $call->return_result("foo");
13
14               # inflate gets a version specific class
15               my $return = JSON::RPC::Common::Procedure::Return->inflate(
16                       version => "2.0",
17                       result  => "foo",
18                       id      => $id,
19               );
20
21               # you can specify a return with an error, it's just an attribute
22               my $return = JSON::RPC::Common::Procedure::Return->new(
23                       error => ...,
24               );
25

DESCRIPTION

27       This class abstracts JSON-RPC procedure returns (results).
28
29       Version specific implementation are provided as well.
30

ATTRIBUTES

32       id  The ID of the call this is a result for.
33
34           Results with no ID are typically error results for parse fails,
35           when the call ID could never be determined.
36
37       result
38           The JSON data that is the result of the call, if any.
39
40       error
41           The error, if any. This is a
42           JSON::RPC::Common::Procedure::Return::Error object (or a version
43           specific subclass).
44
45       error_class
46           The error class to use when instantiating errors.
47

METHODS

49       inflate
50       deflate
51           Go to and from JSON data.
52
53       inflate_error
54       deflate_error
55           Helpers for managing the error sub object.
56
57       set_error
58           Calls "create_error" with it's arguments and sets the error to
59           that.
60
61           E.g.
62
63                   $res->set_error("foo");
64                   $res->error->message; # "foo"
65
66       create_error
67           Instantiate a new error of class error_class using "new_dwim" in
68           JSON::RPC::Common::Procedure::Return::Error.
69
70
71
72perl v5.12.0                      2009-0J1S-O1N0::RPC::Common::Procedure::Return(3)
Impressum