File Coverage

blib/lib/Device/RFXCOM/Response/DateTime.pm
Criterion Covered Total %
statement 24 24 100.0
branch n/a
condition n/a
subroutine 12 12 100.0
pod 7 7 100.0
total 43 43 100.0


line stmt bran cond sub pod time code
1 4     4   25 use strict;
  4         8  
  4         167  
2 4     4   21 use warnings;
  4         15  
  4         205  
3             package Device::RFXCOM::Response::DateTime;
4             $Device::RFXCOM::Response::DateTime::VERSION = '1.142010';
5             # ABSTRACT: Device::RFXCOM::Response class for DateTime message from RFXCOM receiver
6              
7              
8 4     4   86 use 5.006;
  4         15  
  4         170  
9 4     4   20 use constant DEBUG => $ENV{DEVICE_RFXCOM_RESPONSE_DATETIME_DEBUG};
  4         14  
  4         247  
10 4     4   24 use Carp qw/croak/;
  4         8  
  4         1031  
11              
12              
13             sub new {
14 1     1 1 19 my ($pkg, %p) = @_;
15 1         9 bless { %p }, $pkg;
16             }
17              
18              
19 1     1 1 5 sub type { 'datetime' }
20              
21              
22 1     1 1 12 sub device { shift->{device} }
23              
24              
25 1     1 1 5 sub date { shift->{date} }
26              
27              
28 1     1 1 5 sub time { shift->{time} }
29              
30              
31 1     1 1 5 sub day { shift->{day} }
32              
33              
34             sub summary {
35 1     1 1 2 my $self = shift;
36 1         6 $self->type.'/'.$self->device.'='.$self->date.' '.$self->time.' '.$self->day;
37             }
38              
39             1;
40              
41             __END__