File Coverage

blib/lib/DigitalX/AqHive/pH.pm
Criterion Covered Total %
statement 4 5 80.0
branch n/a
condition n/a
subroutine 2 3 66.6
pod n/a
total 6 8 75.0


line stmt bran cond sub pod time code
1             package DigitalX::AqHive::pH;
2             BEGIN {
3 1     1   641 $DigitalX::AqHive::pH::AUTHORITY = 'cpan:GETTY';
4             }
5             $DigitalX::AqHive::pH::VERSION = '0.002';
6 1     1   5 use Digital::Driver;
  1         1  
  1         4  
7              
8             with qw(
9             DigitalX::AqHive
10             );
11              
12             # has delta_0 => (
13             # is => 'lazy',
14             # );
15              
16             # sub _build_delta_0 { 54.20 }
17              
18             # has delta_20 => (
19             # is => 'lazy',
20             # );
21              
22             # sub _build_delta_20 { 58.16 }
23              
24             has delta_25 => (
25             is => 'lazy',
26             );
27              
28 0     0     sub _build_delta_25 { 59.16 }
29              
30             # has delta_grad => (
31             # is => 'lazy',
32             # );
33              
34             # sub _build_delta_grad { 0.1984 }
35              
36             overload_to pH => sub {
37             my ( $self, $val ) = @_;
38             if ($val > 0) {
39             return 7 - ( $val / $self->delta_25 );
40             } elsif ($val < 0) {
41             return 7 + ( abs() / $self->delta_25 );
42             } else {
43             return 7;
44             }
45             }, 'corrected';
46              
47             1;
48              
49             __END__
50              
51             =pod
52              
53             =head1 NAME
54              
55             DigitalX::AqHive::pH
56              
57             =head1 VERSION
58              
59             version 0.002
60              
61             =head1 DESCRIPTION
62              
63             B<IN DEVELOPMENT, DO NOT USE YET>
64              
65             See L<http://aquariumhive.com/> for now.
66              
67             =head1 SUPPORT
68              
69             IRC
70              
71             Join #AquariumHive on irc.freenode.net. Highlight Getty for fast reaction :).
72              
73             Repository
74              
75             https://github.com/homehivelab/aquariumhive
76             Pull request and additional contributors are welcome
77              
78             Issue Tracker
79              
80             https://github.com/homehivelab/aquariumhive/issues
81              
82             =head1 AUTHOR
83              
84             Torsten Raudssus <torsten@raudss.us>
85              
86             =head1 COPYRIGHT AND LICENSE
87              
88             This software is copyright (c) 2014 by Torsten Raudssus.
89              
90             This is free software; you can redistribute it and/or modify it under
91             the same terms as the Perl 5 programming language system itself.
92              
93             =cut