| 1 | package Google::Directions::Response; | ||
| 2 | 3 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 3 | ▶ | use Google::Directions::Types qw/:all/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 3 | ▶ | use Google::Directions::Response::Route; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | =head1 NAME | ||
| 7 | |||
| 8 | Google::Directions::Response - The response to a directions request | ||
| 9 | |||
| 10 | =head1 SYNOPSIS | ||
| 11 | |||
| 12 | my $response = $goog->directions( | ||
| 13 | origin => '25 Thompson Street, New York, NY, United States', | ||
| 14 | destination => '34 Lafayette Street, New York, NY, United States', | ||
| 15 | ); | ||
| 16 | if( $response->status ne 'OK' ){ | ||
| 17 | die( "Status: " . $response->status ); | ||
| 18 | } | ||
| 19 | ... | ||
| 20 | |||
| 21 | =head1 ATTRIBUTES | ||
| 22 | |||
| 23 | =over 4 | ||
| 24 | |||
| 25 | =item I<status> A text representation of the success of the query. | ||
| 26 | |||
| 27 | See API documentation L<here|http://code.google.com/apis/maps/documentation/directions/#StatusCodes> for details. | ||
| 28 | |||
| 29 | =item I<routes> An ArrayRef of L<Google::Directions::Response::Route> objects | ||
| 30 | |||
| 31 | =back | ||
| 32 | |||
| 33 | =cut | ||
| 34 | |||
| 35 | 3 | has 'cached' => ( is => 'rw', isa => 'Bool', writer => 'set_cached' ); | |
| 36 | 3 | has 'status' => ( is => 'ro', isa => StatusCode, required => 1 ); | |
| 37 | 3 | has 'routes' => ( is => 'ro', isa => ArrayRefOfRoutes, coerce => 1 ); | |
| 38 | |||
| 39 | 3 | 1; | |
| 40 | |||
| 41 | =head1 AUTHOR | ||
| 42 | |||
| 43 | Robin Clarke, C<< <perl at robinclarke.net> >> | ||
| 44 | |||
| 45 | =head1 LICENSE AND COPYRIGHT | ||
| 46 | |||
| 47 | Copyright 2012 Robin Clarke. | ||
| 48 | |||
| 49 | This program is free software; you can redistribute it and/or modify it | ||
| 50 | under the terms of either: the GNU General Public License as published | ||
| 51 | by the Free Software Foundation; or the Artistic License. | ||
| 52 | |||
| 53 | See http://dev.perl.org/licenses/ for more information. | ||
| 54 | |||
| 55 | =cut | ||