File Coverage

blib/lib/Google/Directions/Response.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             package Google::Directions::Response;
2 1     1   526 use Moose;
  0            
  0            
3             use Google::Directions::Types qw/:all/;
4             use Google::Directions::Response::Route;
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             has 'cached' => ( is => 'rw', isa => 'Bool', writer => 'set_cached' );
36             has 'status' => ( is => 'ro', isa => StatusCode, required => 1 );
37             has 'routes' => ( is => 'ro', isa => ArrayRefOfRoutes, coerce => 1 );
38              
39             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