Version 0.17.
[gitmo/MooseX-AttributeHelpers.git] / lib / MooseX / AttributeHelpers / Counter.pm
index 70fe41a..38d9875 100644 (file)
@@ -2,7 +2,8 @@
 package MooseX::AttributeHelpers::Counter;
 use Moose;
 
-our $VERSION   = '0.02';
+our $VERSION   = '0.17';
+$VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
 use MooseX::AttributeHelpers::MethodProvider::Counter;
@@ -19,8 +20,8 @@ before 'process_options_for_provides' => sub {
     my ($self, $options, $name) = @_;
 
     # Set some default attribute options here unless already defined
-    if (my $type = $self->helper_type && !exists $options->{isa}){
-        $options->{isa} = $self->helper_type;
+    if ((my $type = $self->helper_type) && !exists $options->{isa}){
+        $options->{isa} = $type;
     }
     
     $options->{is}      = 'ro' unless exists $options->{is};
@@ -44,7 +45,8 @@ after 'check_provides_values' => sub {
 no Moose;
 
 # register the alias ...
-package Moose::Meta::Attribute::Custom::Counter;
+package # hide me from search.cpan.org
+    Moose::Meta::Attribute::Custom::Counter;
 sub register_implementation { 'MooseX::AttributeHelpers::Counter' }
 
 1;
@@ -96,6 +98,8 @@ above. This allows for a very basic counter definition:
 
 =over 4
 
+=item B<meta>
+
 =item B<method_provider>
 
 =item B<has_method_provider>
@@ -119,17 +123,23 @@ modification of the value stored in the attribute.
 
 =over 4
 
+=item I<set>
+
+Set the counter to the specified value.
+
 =item I<inc>
 
-Increments the value stored in this slot by 1.
+Increments the value stored in this slot by 1. Providing an argument will
+cause the counter to be increased by specified amount.
 
 =item I<dec>
 
-Decrements the value stored in this slot by 1.
+Decrements the value stored in this slot by 1. Providing an argument will
+cause the counter to be increased by specified amount.
 
 =item I<reset>
 
-Resets the value stored in this slot to it's default value.
+Resets the value stored in this slot to it's default value. 
 
 =back
 
@@ -145,7 +155,7 @@ Stevan Little E<lt>stevan@iinteractive.comE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2007 by Infinity Interactive, Inc.
+Copyright 2007-2008 by Infinity Interactive, Inc.
 
 L<http://www.iinteractive.com>