use Moose::Role;
use Moose::Meta::Attribute::Native::MethodProvider::Bool;
-our $VERSION = '0.87';
+our $VERSION = '0.95';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
sub _default_is { 'rw' }
sub _helper_type { 'Bool' }
-# NOTE: we don't use the method provider for this module since many of
-# the names of the provided methods would conflict with keywords - SL
-
has 'method_provider' => (
is => 'ro',
isa => 'ClassName',
=head1 NAME
-Moose::Meta::Attribute::Native::Trait::Bool
+Moose::Meta::Attribute::Native::Trait::Bool - Helper trait for Bool attributes
=head1 SYNOPSIS
package Room;
use Moose;
- use Moose::AttributeHelpers;
has 'is_lit' => (
- traits => ['Bool'],
+ traits => ['Bool'],
is => 'rw',
isa => 'Bool',
default => 0,
darken => 'unset',
flip_switch => 'toggle',
is_dark => 'not',
- }
+ },
);
my $room = Room->new();
=over 4
-=item I<set>
+=item B<set>
Sets the value to C<1>.
-=item I<unset>
+=item B<unset>
Set the value to C<0>.
-=item I<toggle>
+=item B<toggle>
-Toggle the value. If it's true, set to false, and vice versa.
+Toggles the value. If it's true, set to false, and vice versa.
-=item I<not>
+=item B<not>
Equivalent of 'not C<$value>'.
=item B<meta>
-=item B<method_constructors>
-
=item B<has_method_provider>
=item B<method_provider>
=head1 BUGS
-All complex software has bugs lurking in it, and this module is no
-exception. If you find a bug please either email me, or add the bug
-to cpan-RT.
+See L<Moose/BUGS> for details on reporting bugs.
=head1 AUTHOR