sync version # to 0.85
[gitmo/Moose.git] / lib / Moose / AttributeHelpers / MethodProvider / Bag.pm
CommitLineData
e3c07b19 1package Moose::AttributeHelpers::MethodProvider::Bag;
2use Moose::Role;
3
115601b6 4our $VERSION = '0.85';
e3c07b19 5$VERSION = eval $VERSION;
6our $AUTHORITY = 'cpan:STEVAN';
7
8with 'Moose::AttributeHelpers::MethodProvider::ImmutableHash';
9
10sub add : method {
046c8b5e 11 my ( $attr, $reader, $writer ) = @_;
12 return sub { $reader->( $_[0] )->{ $_[1] }++ };
e3c07b19 13}
14
15sub delete : method {
046c8b5e 16 my ( $attr, $reader, $writer ) = @_;
17 return sub { CORE::delete $reader->( $_[0] )->{ $_[1] } };
e3c07b19 18}
19
20sub reset : method {
046c8b5e 21 my ( $attr, $reader, $writer ) = @_;
22 return sub { $reader->( $_[0] )->{ $_[1] } = 0 };
e3c07b19 23}
24
251;
26
27__END__
28
29=pod
30
31=head1 NAME
32
33Moose::AttributeHelpers::MethodProvider::Bag
34
35=head1 DESCRIPTION
36
37This is a role which provides the method generators for
38L<Moose::AttributeHelpers::Collection::Bag>.
39
40This role is composed from the
41L<Moose::AttributeHelpers::Collection::ImmutableHash> role.
42
43=head1 METHODS
44
45=over 4
46
47=item B<meta>
48
49=back
50
51=head1 PROVIDED METHODS
52
53=over 4
54
55=item B<count>
56
57=item B<delete>
58
59=item B<empty>
60
61=item B<exists>
62
63=item B<get>
64
65=item B<keys>
66
67=item B<add>
68
69=item B<reset>
70
71=item B<values>
72
73=item B<kv>
74
75=back
76
77=head1 BUGS
78
79All complex software has bugs lurking in it, and this module is no
80exception. If you find a bug please either email me, or add the bug
81to cpan-RT.
82
83=head1 AUTHOR
84
85Stevan Little E<lt>stevan@iinteractive.comE<gt>
86
87=head1 COPYRIGHT AND LICENSE
88
89Copyright 2007-2009 by Infinity Interactive, Inc.
90
91L<http://www.iinteractive.com>
92
93This library is free software; you can redistribute it and/or modify
94it under the same terms as Perl itself.
95
96=cut
97