bump version to 1.09
[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
60f08160 5our $VERSION = '1.09';
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
8b09d5c3 37Moose::Meta::Attribute::Native::MethodProvider::Bool - role providing method generators for Bool trait
e3c07b19 38
39=head1 DESCRIPTION
40
41This is a role which provides the method generators for
e22d28f2 42L<Moose::Meta::Attribute::Native::Trait::Bool>. Please check there for
55a9d564 43documentation on what methods are provided.
e3c07b19 44
45=head1 METHODS
46
47=over 4
48
49=item B<meta>
50
51=back
52
e3c07b19 53=head1 BUGS
54
d4048ef3 55See L<Moose/BUGS> for details on reporting bugs.
e3c07b19 56
57=head1 AUTHOR
58
59Jason May E<lt>jason.a.may@gmail.comE<gt>
60
61=head1 COPYRIGHT AND LICENSE
62
63Copyright 2007-2009 by Infinity Interactive, Inc.
64
65L<http://www.iinteractive.com>
66
67This library is free software; you can redistribute it and/or modify
68it under the same terms as Perl itself.
69
70=cut