File Coverage

blib/lib/Device/RFXCOM/Response/Security.pm
Criterion Covered Total %
statement 23 23 100.0
branch 4 4 100.0
condition n/a
subroutine 12 12 100.0
pod 7 7 100.0
total 46 46 100.0


line stmt bran cond sub pod time code
1 4     4   18 use strict;
  4         7  
  4         143  
2 4     4   18 use warnings;
  4         5  
  4         227  
3             package Device::RFXCOM::Response::Security;
4             $Device::RFXCOM::Response::Security::VERSION = '1.163170';
5             # ABSTRACT: Device::RFXCOM::Response class for Security messages from RFXCOM receiver
6              
7              
8 4     4   70 use 5.006;
  4         13  
9 4     4   19 use constant DEBUG => $ENV{DEVICE_RFXCOM_RESPONSE_SECURITY_DEBUG};
  4         6  
  4         282  
10 4     4   17 use Carp qw/croak/;
  4         6  
  4         820  
11              
12              
13             sub new {
14 9     9 1 30 my ($pkg, %p) = @_;
15 9         113 bless { %p }, $pkg;
16             }
17              
18              
19 9     9 1 36 sub type { 'security' }
20              
21              
22 9     9 1 36 sub device { shift->{device} }
23              
24              
25 9     9 1 33 sub event { shift->{event} }
26              
27              
28 9     9 1 42 sub tamper { shift->{tamper} }
29              
30              
31 9     9 1 49 sub min_delay { shift->{min_delay} }
32              
33              
34             sub summary {
35 9     9 1 16 my $self = shift;
36 9 100       24 $self->type.'/'.$self->device.'/'.$self->event.
    100          
37             ($self->tamper ? '/tamper' : '').
38             ($self->min_delay ? '/min' : '')
39             }
40              
41             1;
42              
43             __END__