Bump to 0.12
[gitmo/MooseX-AttributeHelpers.git] / lib / MooseX / AttributeHelpers / MethodProvider / Bool.pm
CommitLineData
063fae5e 1
2package MooseX::AttributeHelpers::MethodProvider::Bool;
3use Moose::Role;
4
3f58c364 5our $VERSION = '0.12';
063fae5e 6our $AUTHORITY = 'cpan:STEVAN';
7
8sub set : method {
9 my ($attr, $reader, $writer) = @_;
10 return sub { $writer->($_[0], 1) };
11}
12
13sub unset : method {
14 my ($attr, $reader, $writer) = @_;
15 return sub { $writer->($_[0], 0) };
16}
17
18sub toggle : method {
19 my ($attr, $reader, $writer) = @_;
20 return sub { $writer->($_[0], !$reader->($_[0])) };
21}
22
23sub not : method {
24 my ($attr, $reader, $writer) = @_;
25 return sub { !$reader->($_[0]) };
26}
27
281;
29
30__END__
31
32=pod
33
34=head1 NAME
35
36MooseX::AttributeHelpers::MethodProvider::Bool
37
38=head1 DESCRIPTION
39
40This is a role which provides the method generators for
41L<MooseX::AttributeHelpers::Bool>.
42
43=head1 METHODS
44
45=over 4
46
47=item B<meta>
48
49=back
50
51=head1 PROVIDED METHODS
52
53=over 4
54
55=item B<set>
56
57=item B<unset>
58
59=item B<toggle>
60
61=item B<not>
62
63=back
64
65=head1 BUGS
66
67All complex software has bugs lurking in it, and this module is no
68exception. If you find a bug please either email me, or add the bug
69to cpan-RT.
70
71=head1 AUTHOR
72
73Jason May E<lt>jason.a.may@gmail.comE<gt>
74
75=head1 COPYRIGHT AND LICENSE
76
77Copyright 2007-2008 by Infinity Interactive, Inc.
78
79L<http://www.iinteractive.com>
80
81This library is free software; you can redistribute it and/or modify
82it under the same terms as Perl itself.
83
84=cut