| 1 | package WebService::Yelp::Category; | ||
| 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/search_url name category_filter/); | ||
| 8 | |||
| 9 | =head1 NAME | ||
| 10 | |||
| 11 | WebService::Yelp::Category - Yelp.com API Category 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 | for my $b (@{$biz_res->businesses()}) { | ||
| 25 | for my $c (@{$b->categories()}) { | ||
| 26 | my $href = qq[<a href="] . $c->search_url . qq[">] . | ||
| 27 | $c->name . qq[<br>\n]; | ||
| 28 | } | ||
| 29 | } | ||
| 30 | |||
| 31 | =head1 DESCRIPTION | ||
| 32 | |||
| 33 | A business has one or more categories associated with it. You can see | ||
| 34 | Yelp's complete list at: | ||
| 35 | |||
| 36 | http://www.yelp.com/developers/documentation/category_list | ||
| 37 | |||
| 38 | =head1 METHODS (Read Only) | ||
| 39 | |||
| 40 | =head2 name | ||
| 41 | |||
| 42 | Category display name. | ||
| 43 | |||
| 44 | =head2 search_url | ||
| 45 | |||
| 46 | Category search URL for yelp.com for the current location. | ||
| 47 | |||
| 48 | =head2 category_filter | ||
| 49 | |||
| 50 | Category filter name. | ||
| 51 | |||
| 52 | =cut | ||
| 53 | |||
| 54 | 1; | ||