File Coverage

blib/lib/WWW/Asana/Story.pm
Criterion Covered Total %
statement 4 6 66.6
branch n/a
condition n/a
subroutine 2 4 50.0
pod 0 2 0.0
total 6 12 50.0


line stmt bran cond sub pod time code
1             package WWW::Asana::Story;
2             BEGIN {
3 1     1   6694 $WWW::Asana::Story::AUTHORITY = 'cpan:GETTY';
4             }
5             {
6             $WWW::Asana::Story::VERSION = '0.003';
7             }
8             # ABSTRACT: Asana Story Class
9              
10 1     1   21 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::CanReload';
17              
18 0     0 0   sub own_base_args { 'tags', shift->id }
19              
20 0     0 0   sub reload_base_args { 'Tag', 'GET' }
21              
22             has id => (
23             is => 'ro',
24             predicate => 1,
25             );
26              
27             has text => (
28             is => 'ro',
29             predicate => 1,
30             );
31              
32             has type => (
33             is => 'ro',
34             isa => sub {
35             die "type must be 'comment' or 'system'" unless grep { $_[0] eq $_ } qw( comment system );
36             },
37             predicate => 1,
38             );
39              
40             has source => (
41             is => 'ro',
42             isa => sub {
43             die "source must be web, email, mobile, api or unknown"
44             unless grep { $_[0] eq $_ } qw( web email mobile api unknown );
45             },
46             predicate => 1,
47             );
48              
49             has target => (
50             is => 'ro',
51             isa => sub {
52             die "target must be a WWW::Asana::Task or WWW::Asana::Project"
53             unless ref $_[0] eq 'WWW::Asana::Task' or ref $_[0] eq 'WWW::Asana::Project';
54             },
55             required => 1,
56             );
57              
58             has created_by => (
59             is => 'ro',
60             isa => sub {
61             die "created_by must be a WWW::Asana::User" unless ref $_[0] eq 'WWW::Asana::User';
62             },
63             predicate => 1,
64             );
65              
66             has created_at => (
67             is => 'ro',
68             isa => sub {
69             die "created_at must be a DateTime" unless ref $_[0] eq 'DateTime';
70             },
71             predicate => 1,
72             );
73              
74             1;
75              
76             __END__