0.01
[gitmo/MooseX-AttributeHelpers.git] / lib / MooseX / AttributeHelpers / MethodProvider / Counter.pm
1
2 package MooseX::AttributeHelpers::MethodProvider::Counter;
3 use Moose::Role;
4
5 sub inc {
6     my $attr = shift;
7     return sub { $attr->set_value($_[0], $attr->get_value($_[0]) + 1) };
8 }
9
10 sub dec {
11     my $attr = shift;
12     return sub { $attr->set_value($_[0], $attr->get_value($_[0]) - 1) };        
13 }
14
15 1;
16
17 __END__
18
19 =pod
20
21 =head1 NAME
22
23 MooseX::AttributeHelpers::MethodProvider::Counter
24   
25 =head1 DESCRIPTION
26
27 This is a role which provides the method generators for 
28 L<MooseX::AttributeHelpers::Counter>.
29
30 =head1 METHODS
31
32 =over 4
33
34 =item B<meta>
35
36 =back
37
38 =head1 PROVIDED METHODS
39
40 =over 4
41
42 =item B<inc>
43
44 =item B<dec>
45
46 =back
47
48 =head1 BUGS
49
50 All complex software has bugs lurking in it, and this module is no 
51 exception. If you find a bug please either email me, or add the bug
52 to cpan-RT.
53
54 =head1 AUTHOR
55
56 Stevan Little E<lt>stevan@iinteractive.comE<gt>
57
58 =head1 COPYRIGHT AND LICENSE
59
60 Copyright 2007 by Infinity Interactive, Inc.
61
62 L<http://www.iinteractive.com>
63
64 This library is free software; you can redistribute it and/or modify
65 it under the same terms as Perl itself.
66
67 =cut