Acme-FishFarm

 view release on metacpan or  search on metacpan

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

=head2 is_low_water_level

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

=cut

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

=head1 PUMPS RELATED METHODS

For the pumping mechanism, just assume that the pumps can actually pump in certain metres of water each time :)

=head2 water_level_increase_height

Returns the height of water level to increase each water pumping action. See C<pump_water_in> below.

=cut

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

=head2 set_water_level_increase_height ( $new_height )

Sets the height of water level to increase to C<$new_height>.

=cut

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

=head2 pump_water_in

Pumps water into the tank to increase the height of the water level.

=cut

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

=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::WaterLevelMaintainer


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::WaterLevelMaintainer



( run in 2.098 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )