| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package App::Toodledo::Location; | 
| 2 | 1 |  |  | 1 |  | 2936 | use strict; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 37 |  | 
| 3 | 1 |  |  | 1 |  | 6 | use warnings; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 49 |  | 
| 4 |  |  |  |  |  |  |  | 
| 5 |  |  |  |  |  |  | our $VERSION = '1.00'; | 
| 6 |  |  |  |  |  |  |  | 
| 7 | 1 |  |  | 1 |  | 6 | use Carp; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 74 |  | 
| 8 | 1 |  |  | 1 |  | 7 | use Moose; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 9 |  | 
| 9 | 1 |  |  | 1 |  | 6597 | use MooseX::Method::Signatures; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 12 |  | 
| 10 | 1 |  |  | 1 |  | 169 | use App::Toodledo::LocationInternal; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 37 |  | 
| 11 |  |  |  |  |  |  |  | 
| 12 | 1 |  |  | 1 |  | 6 | use Moose::Util::TypeConstraints; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 11 |  | 
| 13 | 1 |  |  | 1 |  | 2226 | BEGIN { class_type 'App::Toodledo' }; | 
| 14 |  |  |  |  |  |  |  | 
| 15 |  |  |  |  |  |  | extends 'App::Toodledo::InternalWrapper'; | 
| 16 |  |  |  |  |  |  |  | 
| 17 |  |  |  |  |  |  | has object => ( is => 'ro', isa => 'App::Toodledo::LocationInternal', | 
| 18 |  |  |  |  |  |  | default => sub { App::Toodledo::LocationInternal->new }, | 
| 19 |  |  |  |  |  |  | handles => sub { __PACKAGE__->internal_attributes( $_[1] ) } ); | 
| 20 |  |  |  |  |  |  |  | 
| 21 |  |  |  |  |  |  |  | 
| 22 | 1 |  |  | 1 |  | 46920 | method add ( App::Toodledo $todo! ) { | 
| 23 |  |  |  |  |  |  | my @args = ( name => $self->name ); | 
| 24 |  |  |  |  |  |  | $self->$_ and push @args, ( $_ => $self->$_ ) for qw(description lat lon); | 
| 25 |  |  |  |  |  |  | my $added_ref = $todo->call_func( location => add => { @args } ); | 
| 26 |  |  |  |  |  |  | $added_ref->[0]{id}; | 
| 27 |  |  |  |  |  |  | } | 
| 28 |  |  |  |  |  |  |  | 
| 29 |  |  |  |  |  |  |  | 
| 30 |  |  |  |  |  |  | 1; | 
| 31 |  |  |  |  |  |  |  | 
| 32 |  |  |  |  |  |  | __END__ | 
| 33 |  |  |  |  |  |  |  | 
| 34 |  |  |  |  |  |  | =head1 NAME | 
| 35 |  |  |  |  |  |  |  | 
| 36 |  |  |  |  |  |  | App::Toodledo::Location - class encapsulating a Toodledo location | 
| 37 |  |  |  |  |  |  |  | 
| 38 |  |  |  |  |  |  | =head1 SYNOPSIS | 
| 39 |  |  |  |  |  |  |  | 
| 40 |  |  |  |  |  |  | $location = App::Toodledo::Location->new; | 
| 41 |  |  |  |  |  |  | $location->name( 'Sydney' ) | 
| 42 |  |  |  |  |  |  | $todo = App::Toodledo->new; | 
| 43 |  |  |  |  |  |  | $todo->add_location( $location ); | 
| 44 |  |  |  |  |  |  |  | 
| 45 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 46 |  |  |  |  |  |  |  | 
| 47 |  |  |  |  |  |  | This class provides accessors for the properties of a Toodledo location. | 
| 48 |  |  |  |  |  |  | The attributes of a location are defined in the L<App::Toodledo::LocationRole> | 
| 49 |  |  |  |  |  |  | module. | 
| 50 |  |  |  |  |  |  |  | 
| 51 |  |  |  |  |  |  | =head1 AUTHOR | 
| 52 |  |  |  |  |  |  |  | 
| 53 |  |  |  |  |  |  | Peter J. Scott, C<< <cpan at psdt.com> >> | 
| 54 |  |  |  |  |  |  |  | 
| 55 |  |  |  |  |  |  | =head1 SEE ALSO | 
| 56 |  |  |  |  |  |  |  | 
| 57 |  |  |  |  |  |  | Toodledo: L<http://www.toodledo.com/>. | 
| 58 |  |  |  |  |  |  |  | 
| 59 |  |  |  |  |  |  | Toodledo API documentation: L<http://www.toodledo.com/info/api_doc.php>. | 
| 60 |  |  |  |  |  |  |  | 
| 61 |  |  |  |  |  |  | =head1 COPYRIGHT & LICENSE | 
| 62 |  |  |  |  |  |  |  | 
| 63 |  |  |  |  |  |  | Copyright 2009-2011 Peter J. Scott, all rights reserved. | 
| 64 |  |  |  |  |  |  |  | 
| 65 |  |  |  |  |  |  | This program is free software; you can redistribute it and/or modify it | 
| 66 |  |  |  |  |  |  | under the same terms as Perl itself. | 
| 67 |  |  |  |  |  |  |  | 
| 68 |  |  |  |  |  |  | =cut |