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