2 package Moose::Meta::Attribute::Native::MethodProvider::Counter;
5 our $VERSION = '0.89_02';
6 $VERSION = eval $VERSION;
7 our $AUTHORITY = 'cpan:STEVAN';
10 my ( $attr, $reader, $writer ) = @_;
11 return sub { $writer->( $_[0], $attr->default( $_[0] ) ) };
15 my ( $attr, $reader, $writer, $value ) = @_;
16 return sub { $writer->( $_[0], $_[1] ) };
20 my ( $attr, $reader, $writer ) = @_;
23 $reader->( $_[0] ) + ( defined( $_[1] ) ? $_[1] : 1 ) );
28 my ( $attr, $reader, $writer ) = @_;
31 $reader->( $_[0] ) - ( defined( $_[1] ) ? $_[1] : 1 ) );
43 Moose::Meta::Attribute::Native::MethodProvider::Counter
47 This is a role which provides the method generators for
48 L<Moose::Meta::Attribute::Native::Trait::Counter>. Please check there for
49 documentation on what methods are provided.
61 All complex software has bugs lurking in it, and this module is no
62 exception. If you find a bug please either email me, or add the bug
67 Stevan Little E<lt>stevan@iinteractive.comE<gt>
69 =head1 COPYRIGHT AND LICENSE
71 Copyright 2007-2009 by Infinity Interactive, Inc.
73 L<http://www.iinteractive.com>
75 This library is free software; you can redistribute it and/or modify
76 it under the same terms as Perl itself.