File Coverage

blib/lib/WWW/Asana/Tag.pm
Criterion Covered Total %
statement 4 12 33.3
branch 0 4 0.0
condition n/a
subroutine 2 7 28.5
pod 0 5 0.0
total 6 28 21.4


line stmt bran cond sub pod time code
1             package WWW::Asana::Tag;
2             BEGIN {
3 1     1   1634 $WWW::Asana::Tag::AUTHORITY = 'cpan:GETTY';
4             }
5             {
6             $WWW::Asana::Tag::VERSION = '0.003';
7             }
8             # ABSTRACT: Asana Tag Class
9              
10 1     1   10 use MooX;
  1         2  
  1         11  
11              
12             with 'WWW::Asana::Role::HasClient';
13             with 'WWW::Asana::Role::HasResponse';
14             with 'WWW::Asana::Role::NewFromResponse';
15              
16             with 'WWW::Asana::Role::HasFollowers';
17              
18             with 'WWW::Asana::Role::CanReload';
19             with 'WWW::Asana::Role::CanUpdate';
20              
21 0     0 0   sub own_base_args { 'tags', shift->id }
22              
23 0     0 0   sub reload_base_args { 'Tag', 'GET' }
24             sub update_args {
25 0     0 0   my ( $self ) = @_;
26 0           'Tag', 'PUT', $self->own_base_args, $self->value_args;
27             }
28             sub create_args {
29 0     0 0   my ( $self ) = @_;
30 0           'Tag', 'POST', 'tags', $self->value_args;
31             }
32             sub value_args {
33 0     0 0   my ( $self ) = @_;
34             return {
35 0 0         workspace => $self->workspace->id,
    0          
36             $self->has_name ? ( name => $self->name ) : (),
37             $self->has_notes ? ( notes => $self->notes ) : (),
38             };
39             }
40              
41             has id => (
42             is => 'ro',
43             predicate => 1,
44             );
45              
46             has name => (
47             is => 'rw',
48             predicate => 1,
49             );
50              
51             has notes => (
52             is => 'rw',
53             predicate => 1,
54             );
55              
56             has created_at => (
57             is => 'ro',
58             isa => sub {
59             die "created_at must be a DateTime" unless ref $_[0] eq 'DateTime';
60             },
61             predicate => 1,
62             );
63              
64             has workspace => (
65             is => 'ro',
66             isa => sub {
67             die "workspace must be a WWW::Asana::Workspace" unless ref $_[0] eq 'WWW::Asana::Workspace';
68             },
69             required => 1,
70             );
71              
72             1;
73              
74             __END__