| 1 | package Google::Directions::Response::Leg; | ||
| 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::Coordinates; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 3 | ▶ | use Google::Directions::Response::Step; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | Google::Directions::Response::Leg - An leg of a journey within a route | ||
| 10 | |||
| 11 | =head1 SYNOPSIS | ||
| 12 | |||
| 13 | my $first_route = shift( @{ $response->routes } ); | ||
| 14 | my @legs = @{ $first_route->legs }; | ||
| 15 | ... | ||
| 16 | |||
| 17 | =head1 ATTRIBUTES | ||
| 18 | |||
| 19 | See API documentation L<here|http://code.google.com/apis/maps/documentation/directions/#Legs> for details. | ||
| 20 | |||
| 21 | =over 4 | ||
| 22 | |||
| 23 | =item I<distance> $integer Distance is always in meters | ||
| 24 | |||
| 25 | =item I<duration> $integer Duration is always in seconds | ||
| 26 | |||
| 27 | =item I<end_address> $string | ||
| 28 | |||
| 29 | =item I<end_location> L<Google::Directions::Response::Coordinates> | ||
| 30 | |||
| 31 | =item I<start_address> $string | ||
| 32 | |||
| 33 | =item I<start_location> L<Google::Directions::Response::Coordinates> | ||
| 34 | |||
| 35 | =item I<steps> ArrayRef of L<Google::Directions::Response::Step> | ||
| 36 | |||
| 37 | =back | ||
| 38 | |||
| 39 | =cut | ||
| 40 | |||
| 41 | 3 | has 'distance' => ( is => 'ro', isa => ValueFromHashRef, | |
| 42 | coerce => 1, | ||
| 43 | required => 1, | ||
| 44 | ); | ||
| 45 | |||
| 46 | 3 | has 'duration' => ( is => 'ro', isa => ValueFromHashRef, | |
| 47 | coerce => 1, | ||
| 48 | required => 1, | ||
| 49 | ); | ||
| 50 | 3 | has 'end_address' => ( is => 'ro', isa => 'Str' ); | |
| 51 | 3 | has 'end_location' => ( is => 'ro', isa => CoordinatesClass, | |
| 52 | coerce => 1, | ||
| 53 | required => 1, | ||
| 54 | ); | ||
| 55 | |||
| 56 | 3 | has 'start_address' => ( is => 'ro', isa => 'Str' ); | |
| 57 | 3 | has 'start_location' => ( is => 'ro', isa => CoordinatesClass, | |
| 58 | coerce => 1, | ||
| 59 | required => 1, | ||
| 60 | ); | ||
| 61 | |||
| 62 | 3 | has 'steps' => ( is => 'ro', isa => ArrayRefOfSteps, | |
| 63 | coerce => 1, | ||
| 64 | ); | ||
| 65 | |||
| 66 | 3 | 1; | |
| 67 | |||
| 68 | =head1 AUTHOR | ||
| 69 | |||
| 70 | Robin Clarke, C<< <perl at robinclarke.net> >> | ||
| 71 | |||
| 72 | =head1 LICENSE AND COPYRIGHT | ||
| 73 | |||
| 74 | Copyright 2012 Robin Clarke. | ||
| 75 | |||
| 76 | This program is free software; you can redistribute it and/or modify it | ||
| 77 | under the terms of either: the GNU General Public License as published | ||
| 78 | by the Free Software Foundation; or the Artistic License. | ||
| 79 | |||
| 80 | See http://dev.perl.org/licenses/ for more information. | ||
| 81 | |||
| 82 | =cut | ||