| 1 | package WebService::Yelp::Business; | ||
| 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/distance neighborhoods state avg_rating city | ||
| 8 | review_count latitude url id longitude | ||
| 9 | rating_img_url_small reviews name categories | ||
| 10 | rating_img_url phone photo_url address1 address2 | ||
| 11 | nearby_url zip photo_url_small/); | ||
| 12 | |||
| 13 | =head1 NAME | ||
| 14 | |||
| 15 | WebService::Yelp::Business - Yelp.com API Business Class (heh, get it?) | ||
| 16 | |||
| 17 | =head1 SYNOPSIS | ||
| 18 | |||
| 19 | use strict; | ||
| 20 | use WebService::Yelp; | ||
| 21 | |||
| 22 | my $yelp = WebService::Yelp->new({ywsid => 'XXXXXXXXXXXX'}); | ||
| 23 | |||
| 24 | my $biz_res = $yelp->search_review_hood({ | ||
| 25 | term => 'cream puffs', | ||
| 26 | location => 'San Francisco', | ||
| 27 | }; | ||
| 28 | for my $b (@{$biz_res->businesses()}) { | ||
| 29 | |||
| 30 | print $b->name " has " . $b->review_count . " review(s)\n"; | ||
| 31 | } | ||
| 32 | |||
| 33 | =head1 DESCRIPTION | ||
| 34 | |||
| 35 | This class represents a business returned from a search. | ||
| 36 | |||
| 37 | |||
| 38 | =head1 METHODS (Read Only) | ||
| 39 | |||
| 40 | =head2 id | ||
| 41 | |||
| 42 | The business id. | ||
| 43 | |||
| 44 | =head2 latitude | ||
| 45 | |||
| 46 | The latitude of the business location. | ||
| 47 | |||
| 48 | =head2 longtitude | ||
| 49 | |||
| 50 | The longitude of the business location. | ||
| 51 | |||
| 52 | =head2 url | ||
| 53 | |||
| 54 | The URL for the business profile. | ||
| 55 | |||
| 56 | =head2 avg_rating | ||
| 57 | |||
| 58 | The business average rating. | ||
| 59 | |||
| 60 | =head2 review_count | ||
| 61 | |||
| 62 | The number of reviews for this business. | ||
| 63 | |||
| 64 | =head2 distance | ||
| 65 | |||
| 66 | The distance from the center of the city. | ||
| 67 | |||
| 68 | =head2 name | ||
| 69 | |||
| 70 | The business name. | ||
| 71 | |||
| 72 | =head2 address1 | ||
| 73 | |||
| 74 | The first line of the business address. | ||
| 75 | |||
| 76 | =head2 address2 | ||
| 77 | |||
| 78 | The second line of the business address. | ||
| 79 | |||
| 80 | =head2 city | ||
| 81 | |||
| 82 | The business city. | ||
| 83 | |||
| 84 | =head2 state | ||
| 85 | |||
| 86 | The business state. | ||
| 87 | |||
| 88 | =head2 zip | ||
| 89 | |||
| 90 | The business zip code. | ||
| 91 | |||
| 92 | =head2 phone | ||
| 93 | |||
| 94 | The business phone number. | ||
| 95 | |||
| 96 | =head2 photo_url | ||
| 97 | |||
| 98 | The url to a thumbnail pic of this business. (100x100 pixels) | ||
| 99 | |||
| 100 | =head2 photo_url_small | ||
| 101 | |||
| 102 | The url to a smaller thumbnail pic of this business. (40x40 pixels) | ||
| 103 | |||
| 104 | =head2 rating_img_url | ||
| 105 | |||
| 106 | The url to the star image for the business rating. | ||
| 107 | |||
| 108 | =head2 nearby_url | ||
| 109 | |||
| 110 | The url to search for other businesses nearby. | ||
| 111 | |||
| 112 | =head2 reviews | ||
| 113 | |||
| 114 | Returns an array reference of (up to) 3 B<WebService::Yelp::Review> objects. | ||
| 115 | |||
| 116 | =head2 categories | ||
| 117 | |||
| 118 | Returns an array reference of B<WebService::Yelp::Category> objects. | ||
| 119 | |||
| 120 | =head2 neighborhoods | ||
| 121 | |||
| 122 | Returns an array reference of B<WebService::Yelp::Neighborhood> objects. | ||
| 123 | |||
| 124 | =cut | ||
| 125 | |||
| 126 | 1; | ||