1Data::Perl::Role::Bool(U3s)er Contributed Perl DocumentatDiaotna::Perl::Role::Bool(3)
2
3
4

NAME

6       Data::Perl::Role::Bool - Wrapping class for boolean values.
7

VERSION

9       version 0.002011
10

SYNOPSIS

12         use Data::Perl qw/bool/;
13
14         my $bool = bool(0);
15
16         $bool->toggle; # 1
17
18         $bool->unset; # 0
19

DESCRIPTION

21       This class provides a wrapper and methods for interacting with boolean
22       values.
23

PROVIDED METHODS

25       None of these methods accept arguments.
26
27       new($value)
28           Constructs a new Data::Perl::Collection::Bool object initialized
29           with the passed in value, and returns it.
30
31       set Sets the value to 1 and returns 1.
32
33       unset
34           Set the value to 0 and returns 0.
35
36       toggle
37           Toggles the value. If it's true, set to false, and vice versa.
38
39           Returns the new value.
40
41       not Equivalent of 'not $value'.
42

SEE ALSO

44       ·   Data::Perl
45
46       ·   MooX::HandlesVia
47

AUTHOR

49       Matthew Phillips <mattp@cpan.org>
50
52       This software is copyright (c) 2020 by Matthew Phillips
53       <mattp@cpan.org>.
54
55       This is free software; you can redistribute it and/or modify it under
56       the same terms as the Perl 5 programming language system itself.
57
58
59
60perl v5.30.1                      2020-01-31         Data::Perl::Role::Bool(3)
Impressum