X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FAttribute%2FNative%2FTrait%2FBool.pm;h=ecace55ef550116fdfdb73a5b7a19819710f3272;hb=870d0f1a40aafaeab1155cae153ac60c47cd12ec;hp=20cf24c66be5b676f2c268480519784778f461f7;hpb=c466e58f62cf93887b29809993bd7830c8350079;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Attribute/Native/Trait/Bool.pm b/lib/Moose/Meta/Attribute/Native/Trait/Bool.pm index 20cf24c..ecace55 100644 --- a/lib/Moose/Meta/Attribute/Native/Trait/Bool.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Bool.pm @@ -2,18 +2,15 @@ package Moose::Meta::Attribute::Native::Trait::Bool; use Moose::Role; use Moose::Meta::Attribute::Native::MethodProvider::Bool; -our $VERSION = '0.87'; +our $VERSION = '0.94'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; with 'Moose::Meta::Attribute::Native::Trait'; -sub _default_is { 'rw' } +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', @@ -29,16 +26,15 @@ no Moose::Role; =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' => ( - metaclass => 'Bool', + traits => ['Bool'], is => 'rw', isa => 'Bool', default => 0, @@ -47,7 +43,7 @@ Moose::Meta::Attribute::Native::Trait::Bool darken => 'unset', flip_switch => 'toggle', is_dark => 'not', - } + }, ); my $room = Room->new(); @@ -61,50 +57,48 @@ Moose::Meta::Attribute::Native::Trait::Bool This provides a simple boolean attribute, which supports most of the basic math operations. -=head1 METHODS - -=over 4 +=head1 PROVIDED METHODS -=item B +These methods are implemented in +L. It is important to +note that all those methods do in place modification of the value stored in +the attribute. -=item B +=over 4 -=item B +=item B -=item B +Sets the value to C<1>. -=back +=item B -=head1 PROVIDED METHODS +Set the value to C<0>. -It is important to note that all those methods do in place -modification of the value stored in the attribute. +=item B -=over 4 +Toggles the value. If it's true, set to false, and vice versa. -=item I +=item B -Sets the value to C<1>. +Equivalent of 'not C<$value>'. -=item I +=back -Set the value to C<0>. +=head1 METHODS -=item I +=over 4 -Toggle the value. If it's true, set to false, and vice versa. +=item B -=item I +=item B -Equivalent of 'not C<$value>'. +=item B =back =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 for details on reporting bugs. =head1 AUTHOR