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;
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};
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;
=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
=head1 COPYRIGHT AND LICENSE
-Copyright 2007 by Infinity Interactive, Inc.
+Copyright 2007-2008 by Infinity Interactive, Inc.
L<http://www.iinteractive.com>