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
40 metaclass => 'Counter',
50 my $page = MyHomePage->new();
51 $page->inc_counter; # same as $page->counter($page->counter + 1);
52 $page->dec_counter; # same as $page->counter($page->counter - 1);
60 All complex software has bugs lurking in it, and this module is no
61 exception. If you find a bug please either email me, or add the bug
66 Stevan Little E<lt>stevan@iinteractive.comE<gt>
68 =head1 COPYRIGHT AND LICENSE
70 Copyright 2007 by Infinity Interactive, Inc.
72 L<http://www.iinteractive.com>
74 This library is free software; you can redistribute it and/or modify
75 it under the same terms as Perl itself.