File Coverage

blib/lib/WWW/Asana/Role/CanCreate.pm
Criterion Covered Total %
statement 4 7 57.1
branch 0 2 0.0
condition n/a
subroutine 2 3 66.6
pod 0 1 0.0
total 6 13 46.1


line stmt bran cond sub pod time code
1             package WWW::Asana::Role::CanCreate;
2             BEGIN {
3 1     1   3836 $WWW::Asana::Role::CanCreate::AUTHORITY = 'cpan:GETTY';
4             }
5             {
6             $WWW::Asana::Role::CanCreate::VERSION = '0.003';
7             }
8             # ABSTRACT: Role for Asana classes which can be created
9              
10 1     1   12 use MooX::Role;
  1         4  
  1         10  
11              
12             requires qw(
13             create_args
14             );
15              
16             sub create {
17 0     0 0   my $self = shift;
18 0 0         die "The object already has an id, and so cant be created" if $self->has_id;
19 0           $self->do($self->create_args(@_));
20             }
21              
22             1;
23             __END__