File Coverage

blib/lib/AnyEvent/WebService/Tracks/Context.pm
Criterion Covered Total %
statement 9 22 40.9
branch n/a
condition n/a
subroutine 3 9 33.3
pod 6 6 100.0
total 18 37 48.6


line stmt bran cond sub pod time code
1             package AnyEvent::WebService::Tracks::Context;
2              
3 1     1   3810 use strict;
  1         2  
  1         27  
4 1     1   4 use warnings;
  1         1  
  1         23  
5 1     1   4 use parent 'AnyEvent::WebService::Tracks::Resource';
  1         2  
  1         6  
6              
7             our $VERSION = '0.02';
8              
9             __PACKAGE__->readonly(qw/created_at id updated_at/);
10             __PACKAGE__->accessor(qw/name position/);
11              
12             sub resource_path {
13 0     0 1   return 'contexts';
14             }
15              
16             sub xml_root {
17 0     0 1   return 'context';
18             }
19              
20             sub is_hidden {
21 0     0 1   my ( $self ) = @_;
22              
23 0           return $self->{'hide'} eq 'true';
24             }
25              
26             sub hide {
27 0     0 1   my ( $self ) = @_;
28              
29 0           $self->{'hide'} = 'true';
30 0           $self->{'_dirty'}{'hide'} = 1;
31             }
32              
33             sub unhide {
34 0     0 1   my ( $self ) = @_;
35              
36 0           $self->{'hide'} = 'false';
37 0           $self->{'_dirty'}{'hide'} = 1;
38             }
39              
40             sub todos {
41 0     0 1   my ( $self, $cb ) = @_;
42              
43 0           my $id = $self->id;
44 0           $self->{'parent'}->fetch_multiple("contexts/$id/todos",
45             'AnyEvent::WebService::Tracks::Todo', $cb);
46             };
47              
48             1;
49              
50             __END__