NAME

Sub::HandlesVia::HandlerLibrary::Bool - library of Bool-related methods

SYNOPSIS

package My::Class {
  use Moo;
  use Sub::HandlesVia;
  use Types::Standard 'Bool';
  has my_bool => (
    is => 'ro',
    isa => Bool,
    handles_via => 'Bool',
    handles => {
      'my_not' => 'not',
      'my_reset' => 'reset',
      'my_set' => 'set',
      'my_toggle' => 'toggle',
      'my_unset' => 'unset',
    },
  );
}

DESCRIPTION

This is a library of methods for Sub::HandlesVia.

DELEGATABLE METHODS

not()

Returns the opposite value of the boolean.

reset()

Sets the boolean to its default value, or false if it has no default.

set()

Sets the value of the boolean to true.

toggle()

Toggles the truth value of the boolean.

unset()

Sets the value of the boolean to false.

BUGS

Please report any bugs to https://github.com/tobyink/p5-sub-handlesvia/issues.

SEE ALSO

Sub::HandlesVia.

AUTHOR

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE

This software is copyright (c) 2020, 2022 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

DISCLAIMER OF WARRANTIES

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.