X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FAttribute%2FNative%2FTrait%2FCounter.pm;h=b8c3f8542f1c7d3a17d112dce245cd4e40d251b6;hb=2e7576bdd6c4a179beadc2d21623c6cad1d66469;hp=b82d35117193467955b6f5e884b3a7b23c7870fa;hpb=122a129ac1b02a53a4ac31f848a9bc89ce8feacf;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Attribute/Native/Trait/Counter.pm b/lib/Moose/Meta/Attribute/Native/Trait/Counter.pm index b82d351..b8c3f85 100644 --- a/lib/Moose/Meta/Attribute/Native/Trait/Counter.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Counter.pm @@ -2,7 +2,7 @@ package Moose::Meta::Attribute::Native::Trait::Counter; use Moose::Role; -our $VERSION = '0.89'; +our $VERSION = '0.96'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -21,22 +21,6 @@ sub _default_default { 0 } sub _default_is { 'ro' } sub _helper_type { 'Num' } -after '_check_handles_values' => sub { - my $self = shift; - my $handles = $self->handles; - - unless ( scalar keys %$handles ) { - my $method_constructors = $self->method_constructors; - my $attr_name = $self->name; - - foreach my $method ( keys %$method_constructors ) { - $handles->{ $method . '_' . $attr_name } = $method; - } - - $self->_set_handles($handles); - } -}; - no Moose::Role; 1; @@ -47,7 +31,7 @@ __END__ =head1 NAME -Moose::Meta::Attribute::Native::Trait::Counter +Moose::Meta::Attribute::Native::Trait::Counter - Helper trait for counters =head1 SYNOPSIS @@ -55,7 +39,7 @@ Moose::Meta::Attribute::Native::Trait::Counter use Moose; has 'counter' => ( - traits => ['Counter'], + traits => ['Counter'], is => 'ro', isa => 'Num', default => 0, @@ -63,7 +47,7 @@ Moose::Meta::Attribute::Native::Trait::Counter inc_counter => 'inc', dec_counter => 'dec', reset_counter => 'reset', - } + }, ); my $page = MyHomePage->new(); @@ -92,21 +76,21 @@ the attribute. =over 4 -=item I +=item B Set the counter to the specified value. -=item I +=item B Increments the value stored in this slot by 1. Providing an argument will cause the counter to be increased by specified amount. -=item I +=item B Decrements the value stored in this slot by 1. Providing an argument will cause the counter to be increased by specified amount. -=item I +=item B Resets the value stored in this slot to it's default value. @@ -126,9 +110,7 @@ Resets the value stored in this slot to it's default value. =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