JMAP::Tester::Response::Sentence - a single triple within a JMAP response
version 0.103
These objects represent sentences in the JMAP response. That is, if your response is:
[ [ "messages", { ... }, "a" ], # 1 [ "smellUpdates", { ... }, "b" ], # 2 [ "smells", { ... }, "b" ], # 3 ]
...then #1, #2, and #3 are each a single sentence.
The first item in the triple is accessed with the name method. The second is accessed with the arguments method. The third, with the client_id method.
name
arguments
client_id
This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years.
Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl.
as_triple returns the underlying JSON data of the sentence, which may include objects used to convey type information for booleans, strings, and numbers.
as_triple
For unblessed data, use as_stripped_triple.
as_stripped_triple
These return a three-element arrayref.
as_pair returns the same thing as as_triple, but without the client_id. That means it returns a two-element arrayref.
as_pair
as_stripped_pair returns the same minus JSON type information.
as_stripped_pair
This method returns a JMAP::Tester::Response::Sentence::Set object for the current sentence. That's a specialized Sentence for setFoos-style JMAP method responses.
setFoos
$sentence->assert_named("theName")
This method aborts unless the sentence's name is the given name. Otherwise, it returns the sentence.
Ricardo SIGNES <cpan@semiotic.systems>
This software is copyright (c) 2016 by Fastmail Pty. Ltd.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install JMAP::Tester, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JMAP::Tester
CPAN shell
perl -MCPAN -e shell install JMAP::Tester
For more information on module installation, please visit the detailed CPAN module installation guide.