2 package MooseX::AttributeHelpers::MethodProvider::Counter;
6 our $AUTHORITY = 'cpan:STEVAN';
9 my ($attr, $reader, $writer) = @_;
10 return sub { $writer->($_[0], $attr->default($_[0])) };
14 my ($attr, $reader, $writer) = @_;
15 return sub { $writer->($_[0], $reader->($_[0]) + 1) };
19 my ($attr, $reader, $writer) = @_;
20 return sub { $writer->($_[0], $reader->($_[0]) - 1) };
31 MooseX::AttributeHelpers::MethodProvider::Counter
35 This is a role which provides the method generators for
36 L<MooseX::AttributeHelpers::Counter>.
38 =head1 PROVIDED METHODS
44 Increments the value stored in this slot by 1.
48 Decrements the value stored in this slot by 1.
52 Resets the value stored in this slot to its default value.
58 All complex software has bugs lurking in it, and this module is no
59 exception. If you find a bug please either email me, or add the bug
64 Stevan Little E<lt>stevan@iinteractive.comE<gt>
66 =head1 COPYRIGHT AND LICENSE
68 Copyright 2007-2008 by Infinity Interactive, Inc.
70 L<http://www.iinteractive.com>
72 This library is free software; you can redistribute it and/or modify
73 it under the same terms as Perl itself.