Yelp/Message.pm

filter: Statementstmt 100% 9 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 12 / 12 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Yelp/Category.pm ↑ Summary Yelp/Neighborhood.pm »
1 package WebService::Yelp::Message;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use base qw/Class::Accessor/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 __PACKAGE__->mk_ro_accessors(qw/version text code/);
8  
9 =head1 NAME
10  
11 WebService::Yelp::Message - Yelp.com API Message Class
12  
13 =head1 SYNOPSIS
14  
15 use strict;
16 use WebService::Yelp;
17  
18 my $yelp = WebService::Yelp->new({ywsid => 'XXXXXXXXXXXX'});
19  
20 my $biz_res = $yelp->search_review_hood({
21 term => 'cream puffs',
22 location => 'San Francisco',
23 };
24 my $message = $biz_res->message();
25  
26 if($message->code() == 0) {
27 # everything is ok, continue with search results processing
28 }
29 else {
30 print "search failed with code:" . $message->code() . ":" .
31 $message->text();
32 }
33  
34  
35 =head1 DESCRIPTION
36  
37 This class represents the status of a search result. A code of 0 means success,
38 otherwise something bad happened.
39  
40 http://www.yelp.com/developers/documentation/search_api
41  
42  
43 =head1 METHODS (Read Only)
44  
45 =head2 code
46  
47 The response code
48  
49 =head2 text
50  
51 The response message.
52  
53 =head2 version
54  
55 The API version
56  
57 =cut
58 1;
« Yelp/Category.pm ↑ Summary Yelp/Neighborhood.pm »