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