Acme-FishFarm

 view release on metacpan or  search on metacpan

lib/Acme/FishFarm/OxygenMaintainer.pm  view on Meta::CPAN


Returns C<1> if the DO level is less than the threshold value. Otherwise, returns C<0>.

=cut

sub is_low_DO {
    ref( my $self = shift ) or croak "Please use this the OO way";
    if ( $self->{current_DO} < $self->{DO_threshold} ) {
        return 1;
    } else {
        return 0;
    }
}


=head1 OXYGEN GENERATING RELATED METHODS

=head2 oxygen_generation_volume

Returns the oxygen generation rate.

=cut

sub oxygen_generation_volume {
    ref( my $self = shift ) or croak "Please use this the OO way";
    $self->{DO_generation_volume};
}

=head2 set_oxygen_generation_volume ( $new_rate )

Sets the new oxygen generation rate to C<$new_rate>.

=cut

sub set_oxygen_generation_volume {
    ref( my $self = shift ) or croak "Please use this the OO way";
    $self->{DO_generation_volume} = shift;
}

=head2 generate_oxygen

Pumps oxygen into the water based on the diffusion rate. The current DO value will increase every time this action is invoked.

Take note that this will generate oxygen no matter what. Make sure you check the DO content before pumping oxygen into your tank. See C<is_low_DO> method above for more info.

=cut

sub generate_oxygen {
    ref( my $self = shift ) or croak "Please use this the OO way";
    $self->{current_DO} += $self->{DO_generation_volume};
}

=head1 AUTHOR

Raphael Jong Jun Jie, C<< <ellednera at cpan.org> >>

=head1 BUGS

Please report any bugs or feature requests to C<bug-. at rt.cpan.org>, or through
the web interface at L<https://rt.cpan.org/NoAuth/ReportBug.html?Queue=.>.  I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.




=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Acme::FishFarm::OxygenMaintainer


You can also look for information at:

=over 4

=item * RT: CPAN's request tracker (report bugs here)

L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=.>

=item * CPAN Ratings

L<https://cpanratings.perl.org/d/.>

=item * Search CPAN

L<https://metacpan.org/release/.>

=back


=head1 ACKNOWLEDGEMENTS

Besiyata d'shmaya

=head1 LICENSE AND COPYRIGHT

This software is Copyright (c) 2021 by Raphael Jong Jun Jie.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)


=cut

1; # End of Acme::FishFarm::OxygenMaintainer



( run in 0.910 second using v1.01-cache-2.11-cpan-0fb53d1c279 )