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

VERSION

9       version 0.11
10

SYNOPSIS

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

DESCRIPTION

30       This class abstracts JSON-RPC procedure returns (results).
31
32       Version specific implementation are provided as well.
33

ATTRIBUTES

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

METHODS

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

AUTHOR

74       Yuval Kogman <nothingmuch@woobling.org>
75
77       This software is copyright (c) 2014 by Yuval Kogman and others.
78
79       This is free software; you can redistribute it and/or modify it under
80       the same terms as the Perl 5 programming language system itself.
81
82
83
84perl v5.36.0                      2022-0J7S-O2N2::RPC::Common::Procedure::Return(3)
Impressum