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 1     1   958 use strict;
  1         2  
  1         43  
3 1     1   7 use warnings;
  1         3  
  1         41  
4              
5             our $VERSION = '1.01';
6              
7 1     1   7 use Carp;
  1         2  
  1         68  
8 1     1   5 use Moose;
  1         2  
  1         6  
9 1     1   5916 use MooseX::Method::Signatures;
  1         2  
  1         13  
10 1     1   698 use App::Toodledo::FolderInternal;
  1         3  
  1         50  
11              
12 1     1   12 use Moose::Util::TypeConstraints;
  1         2  
  1         12  
13 1     1   2130 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 1     1   47291 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