blib/lib/Net/PulseMeter/Sensor/Indicator.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 13 | 13 | 100.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 5 | 5 | 100.0 |
pod | 0 | 2 | 0.0 |
total | 18 | 20 | 90.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Net::PulseMeter::Sensor::Indicator; | ||||||
2 | 2 | 2 | 669 | use strict; | |||
2 | 12 | ||||||
2 | 67 | ||||||
3 | 2 | 2 | 10 | use warnings 'all'; | |||
2 | 3 | ||||||
2 | 73 | ||||||
4 | |||||||
5 | 2 | 2 | 11 | use base qw/Net::PulseMeter::Sensor::Base/; | |||
2 | 3 | ||||||
2 | 349 | ||||||
6 | |||||||
7 | sub event { | ||||||
8 | 1 | 1 | 0 | 3 | my ($self, $value) = @_; | ||
9 | 1 | 10 | $self->r->set($self->value_key, $value); | ||||
10 | } | ||||||
11 | |||||||
12 | sub value_key { | ||||||
13 | 5 | 5 | 0 | 8 | my $self = shift; | ||
14 | 5 | 36 | sprintf("pulse_meter:value:%s", $self->name); | ||||
15 | } | ||||||
16 | |||||||
17 | 1; |