File Coverage

blib/lib/App/Toodledo/Folder.pm
Criterion Covered Total %
statement 23 23 100.0
branch n/a
condition n/a
subroutine 9 9 100.0
pod n/a
total 32 32 100.0


line stmt bran cond sub pod time code
1             package App::Toodledo::Folder;
2 2     2   2300 use strict;
  2         5  
  2         54  
3 2     2   8 use warnings;
  2         5  
  2         75  
4              
5             our $VERSION = '1.01';
6              
7 2     2   11 use Carp;
  2         2  
  2         150  
8 2     2   11 use Moose;
  2         5  
  2         14  
9 2     2   11688 use MooseX::Method::Signatures;
  2         5  
  2         17  
10 2     2   604 use App::Toodledo::FolderInternal;
  2         5  
  2         66  
11              
12 2     2   12 use Moose::Util::TypeConstraints;
  2         4  
  2         16  
13 2     2   3918 BEGIN { class_type 'App::Toodledo' };
14              
15             extends 'App::Toodledo::InternalWrapper';
16              
17             has object => ( is => 'ro', isa => 'App::Toodledo::FolderInternal',
18             default => sub { App::Toodledo::FolderInternal->new },
19             handles => sub { __PACKAGE__->internal_attributes( $_[1] ) } );
20              
21              
22 2     2   96221 method add ( App::Toodledo $todo! ) {
23             my @args = ( name => $self->name );
24             $self->$_ and push @args, ( $_ => $self->$_ ) for qw(private archived ord);
25             my $added_ref = $todo->call_func( folder => add => { @args } );
26             $added_ref->[0]{id};
27             }
28              
29              
30             1;
31              
32             __END__
33              
34             =head1 NAME
35              
36             App::Toodledo::Folder - class encapsulating a Toodledo folder
37              
38             =head1 SYNOPSIS
39              
40             $folder = App::Toodledo::Folder->new;
41             $folder->name( 'Shopping List' )
42             $todo = App::Toodledo->new;
43             $todo->add_folder( $folder );
44              
45             =head1 DESCRIPTION
46              
47             This class provides accessors for the properties of a Toodledo folder.
48             The attributes of a folder are defined in the L<App::Toodledo::FolderRole>
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