JMAP::Tester::Response::Paragraph - a group of sentences in a JMAP response
version 0.022
These objects represent paragraphs in the JMAP response. That is, if your response is:
[ [ "messages", { ... }, "a" ], # 1 [ "smellUpdates", { ... }, "b" ], # 2 [ "smells", { ... }, "b" ], # 3 ]
...then #1 forms one paragraph and #2 and #3 together form another. It goes by matching client ids.
The sentences method returns a list of Sentence objects, one for each sentence in the paragraph.
sentences
my $sentence = $para->sentence($n);
This method returns the nth sentence of the paragraph.
my $sentence = $para->single; my $sentence = $para->single($name);
This method throws an exception if there is more than one sentence in the paragraph. If a $name argument is given and the paragraph's single sentence doesn't have that name, an exception is raised.
$name
Otherwise, this method returns the sentence.
my ($s1, $s2, ...) = $paragraph->assert_n_sentences($n);
This method returns all the sentences in the paragarph, as long as there are exactly $n. Otherwise, it aborts.
$n
my $sentence = $paragraph->sentence_named($name);
This method returns the sentence with the given name. If no such sentence exists, or if two sentences with the name exist, the tester will abort.
as_triples returns an arrayref containing the result of calling as_triple on each sentence in the paragraph. as_stripped_triples removes JSON types.
as_triples
as_triple
as_stripped_triples
as_pairs returns an arrayref containing the result of calling as_pair on each sentence in the paragraph. as_stripped_pairs removes JSON types.
as_pairs
as_pair
as_stripped_pairs
Ricardo SIGNES <rjbs@cpan.org>
This software is copyright (c) 2016 by FastMail, 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.