X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FAttributeHelpers%2FCounter.pm;h=38d98751e03bcbca082ab86c685d2183be3f1db8;hb=refs%2Ftags%2F0.17;hp=31da9ff1d795b1676a636a66ccc1643beed025a7;hpb=b91f57afe2beaf8f2c49b42ea732c05332a8d04c;p=gitmo%2FMooseX-AttributeHelpers.git diff --git a/lib/MooseX/AttributeHelpers/Counter.pm b/lib/MooseX/AttributeHelpers/Counter.pm index 31da9ff..38d9875 100644 --- a/lib/MooseX/AttributeHelpers/Counter.pm +++ b/lib/MooseX/AttributeHelpers/Counter.pm @@ -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; @@ -121,17 +123,23 @@ modification of the value stored in the attribute. =over 4 +=item I + +Set the counter to the specified value. + =item I -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 -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 -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 @@ -147,7 +155,7 @@ Stevan Little Estevan@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2007 by Infinity Interactive, Inc. +Copyright 2007-2008 by Infinity Interactive, Inc. L