From: Chris Prather Date: Sun, 9 Aug 2009 20:39:14 +0000 (-0400) Subject: update Counter documentation X-Git-Tag: 0.89_02~77 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7250a96871ad8dd771caa728ac9a3051fc38643b;p=gitmo%2FMoose.git update Counter documentation --- diff --git a/lib/Moose/Meta/Attribute/Native/MethodProvider/Counter.pm b/lib/Moose/Meta/Attribute/Native/MethodProvider/Counter.pm index 52f43d3..7fce671 100644 --- a/lib/Moose/Meta/Attribute/Native/MethodProvider/Counter.pm +++ b/lib/Moose/Meta/Attribute/Native/MethodProvider/Counter.pm @@ -45,7 +45,8 @@ Moose::Meta::Attribute::Native::MethodProvider::Counter =head1 DESCRIPTION This is a role which provides the method generators for -L. +L. Please check there for +documentation on what methods are provided. =head1 METHODS @@ -55,20 +56,6 @@ L. =back -=head1 PROVIDED METHODS - -=over 4 - -=item B - -=item B - -=item B - -=item B - -=back - =head1 BUGS All complex software has bugs lurking in it, and this module is no diff --git a/lib/Moose/Meta/Attribute/Native/Trait/Counter.pm b/lib/Moose/Meta/Attribute/Native/Trait/Counter.pm index 2a86a62..f71fa71 100644 --- a/lib/Moose/Meta/Attribute/Native/Trait/Counter.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Counter.pm @@ -56,7 +56,7 @@ Moose::Meta::Attribute::Native::Trait::Counter use Moose::AttributeHelpers; has 'counter' => ( - metaclass => 'Counter', + traits => ['Counter'], is => 'ro', isa => 'Num', default => 0, @@ -77,29 +77,19 @@ This module provides a simple counter attribute, which can be incremented and decremented. If your attribute definition does not include any of I, I, -I or I but does use the C metaclass, +I or I but does use the C trait, then this module applies defaults as in the L above. This allows for a very basic counter definition: - has 'foo' => (metaclass => 'Counter'); + has 'foo' => (traits => ['Counter']); $obj->inc_foo; -=head1 METHODS - -=over 4 - -=item B - -=item B - -=item B - -=back - =head1 PROVIDED METHODS -It is important to note that all those methods do in place -modification of the value stored in the attribute. +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. =over 4 @@ -123,6 +113,18 @@ Resets the value stored in this slot to it's default value. =back +=head1 METHODS + +=over 4 + +=item B + +=item B + +=item B + +=back + =head1 BUGS All complex software has bugs lurking in it, and this module is no