2 package MooseX::AttributeHelpers::Counter;
6 our $AUTHORITY = 'cpan:STEVAN';
8 use MooseX::AttributeHelpers::MethodProvider::Counter;
10 extends 'MooseX::AttributeHelpers::Base';
12 has '+method_provider' => (
13 default => 'MooseX::AttributeHelpers::MethodProvider::Counter'
16 sub helper_type { 'Num' }
20 # register the alias ...
21 package Moose::Meta::Attribute::Custom::Counter;
22 sub register_implementation { 'MooseX::AttributeHelpers::Counter' }
32 MooseX::AttributeHelpers::Counter
38 use MooseX::AttributeHelpers;
41 metaclass => 'Counter',
51 my $page = MyHomePage->new();
52 $page->inc_counter; # same as $page->counter($page->counter + 1);
53 $page->dec_counter; # same as $page->counter($page->counter - 1);
57 This module provides a simple counter attribute, which can be
58 incremented and decremeneted.
64 =item B<method_provider>
66 =item B<has_method_provider>
74 All complex software has bugs lurking in it, and this module is no
75 exception. If you find a bug please either email me, or add the bug
80 Stevan Little E<lt>stevan@iinteractive.comE<gt>
82 =head1 COPYRIGHT AND LICENSE
84 Copyright 2007 by Infinity Interactive, Inc.
86 L<http://www.iinteractive.com>
88 This library is free software; you can redistribute it and/or modify
89 it under the same terms as Perl itself.