1 package MooseX::AttributeHelpers::MethodProvider::Bag;
5 our $AUTHORITY = 'cpan:STEVAN';
7 with 'MooseX::AttributeHelpers::MethodProvider::ImmutableHash';
10 my ($attr, $reader, $writer) = @_;
11 return sub { $reader->($_[0])->{$_[1]}++ };
15 my ($attr, $reader, $writer) = @_;
16 return sub { CORE::delete $reader->($_[0])->{$_[1]} };
20 my ($attr, $reader, $writer) = @_;
21 return sub { $reader->($_[0])->{$_[1]} = 0 };
32 MooseX::AttributeHelpers::MethodProvider::Bag
36 This is a role which provides the method generators for
37 L<MooseX::AttributeHelpers::Collection::Bag>.
39 This role is composed from the
40 L<MooseX::AttributeHelpers::Collection::ImmutableHash> role.
50 =head1 PROVIDED METHODS
78 All complex software has bugs lurking in it, and this module is no
79 exception. If you find a bug please either email me, or add the bug
84 Stevan Little E<lt>stevan@iinteractive.comE<gt>
86 =head1 COPYRIGHT AND LICENSE
88 Copyright 2007-2008 by Infinity Interactive, Inc.
90 L<http://www.iinteractive.com>
92 This library is free software; you can redistribute it and/or modify
93 it under the same terms as Perl itself.