2 package Moose::AttributeHelpers::Trait::Collection::Bag;
4 use Moose::Util::TypeConstraints;
7 $VERSION = eval $VERSION;
8 our $AUTHORITY = 'cpan:STEVAN';
10 use Moose::AttributeHelpers::MethodProvider::Bag;
12 with 'Moose::AttributeHelpers::Trait::Collection';
14 has 'method_provider' => (
17 predicate => 'has_method_provider',
18 default => 'Moose::AttributeHelpers::MethodProvider::Bag'
21 subtype 'Bag' => as 'HashRef[Int]';
23 sub _helper_type { 'Bag' }
25 sub _default_default { sub { {} } }
28 no Moose::Util::TypeConstraints;
30 package # hide me from search.cpan.org
31 Moose::Meta::Attribute::Custom::Trait::Collection::Bag;
32 sub register_implementation {
33 'Moose::AttributeHelpers::Trait::Collection::Bag'
44 Moose::AttributeHelpers::Collection::Bag
50 use Moose::AttributeHelpers;
52 has 'word_histogram' => (
53 metaclass => 'Collection::Bag',
55 isa => 'Bag', # optional ... as is defalt
58 get_count_for => 'get',
59 has_any_words => 'empty',
61 delete_word => 'delete',
67 This module provides a Bag attribute which provides a number of
68 bag-like operations. See L<Moose::AttributeHelpers::MethodProvider::Bag>
77 =item B<method_provider>
79 =item B<has_method_provider>
85 All complex software has bugs lurking in it, and this module is no
86 exception. If you find a bug please either email me, or add the bug
91 Stevan Little E<lt>stevan@iinteractive.comE<gt>
93 =head1 COPYRIGHT AND LICENSE
95 Copyright 2007-2009 by Infinity Interactive, Inc.
97 L<http://www.iinteractive.com>
99 This library is free software; you can redistribute it and/or modify
100 it under the same terms as Perl itself.