File Coverage

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


line stmt bran cond sub pod time code
1 5     5   22 use strict;
  5         7  
  5         148  
2 5     5   20 use warnings;
  5         8  
  5         349  
3             package Device::RFXCOM::Response::Sensor;
4             $Device::RFXCOM::Response::Sensor::VERSION = '1.163170';
5             # ABSTRACT: Device::RFXCOM::Response class for Sensor message from RFXCOM receiver
6              
7              
8 5     5   84 use 5.006;
  5         14  
9 5     5   22 use constant DEBUG => $ENV{DEVICE_RFXCOM_RESPONSE_SENSOR_DEBUG};
  5         10  
  5         312  
10 5     5   24 use Carp qw/croak/;
  5         5  
  5         1140  
11              
12              
13             sub new {
14 85     85 1 362 my ($pkg, %p) = @_;
15 85         667 bless { %p }, $pkg;
16             }
17              
18              
19 85     85 1 300 sub type { 'sensor' }
20              
21              
22 85     85 1 239 sub measurement { shift->{measurement} }
23              
24              
25 85     85 1 259 sub device { shift->{device} }
26              
27              
28 85     85 1 462 sub value { shift->{value} }
29              
30              
31 85     85 1 824 sub units { shift->{units} }
32              
33              
34             sub summary {
35 85     85 1 108 my $self = shift;
36 85   100     185 $self->type.'/'.
37             $self->device.'['.$self->measurement.']='.$self->value.($self->units||'');
38             }
39              
40             1;
41              
42             __END__