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, $value) = @_;
15 return sub { $writer->($_[0], $_[1]) };
19 my ($attr, $reader, $writer) = @_;
20 return sub { $writer->($_[0], $reader->($_[0]) + (defined($_[1]) ? $_[1] : 1) ) };
24 my ($attr, $reader, $writer) = @_;
25 return sub { $writer->($_[0], $reader->($_[0]) - (defined($_[1]) ? $_[1] : 1) ) };
36 MooseX::AttributeHelpers::MethodProvider::Counter
40 This is a role which provides the method generators for
41 L<MooseX::AttributeHelpers::Counter>.
51 =head1 PROVIDED METHODS
67 All complex software has bugs lurking in it, and this module is no
68 exception. If you find a bug please either email me, or add the bug
73 Stevan Little E<lt>stevan@iinteractive.comE<gt>
75 =head1 COPYRIGHT AND LICENSE
77 Copyright 2007-2008 by Infinity Interactive, Inc.
79 L<http://www.iinteractive.com>
81 This library is free software; you can redistribute it and/or modify
82 it under the same terms as Perl itself.