File Coverage

blib/lib/WWW/Jawbone/Up/Score/Sleep.pm
Criterion Covered Total %
statement 20 20 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 0 4 0.0
total 28 32 87.5


line stmt bran cond sub pod time code
1             package WWW::Jawbone::Up::Score::Sleep;
2              
3 1     1   27 use 5.010;
  1         5  
  1         47  
4 1     1   7 use strict;
  1         18  
  1         44  
5 1     1   6 use warnings;
  1         2  
  1         40  
6              
7 1     1   6 use base 'WWW::Jawbone::Up::JSON';
  1         2  
  1         281  
8              
9             __PACKAGE__->add_accessors(qw(awakenings light awake time_to_sleep));
10              
11             sub bedtime {
12 1     1 0 8 my $self = shift;
13 1         14 return $self->{goals}{bedtime}[0];
14             }
15              
16             sub deep {
17 3     3 0 7 my $self = shift;
18 3         25 return $self->{goals}{deep}[0];
19             }
20              
21             sub asleep {
22 2     2 0 5 my $self = shift;
23 2         10 return $self->light + $self->deep;
24             }
25              
26             sub in_bed {
27 1     1 0 3 my $self = shift;
28 1         5 return $self->asleep + $self->awake;
29             }
30              
31             1;