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 # register the alias ...
31 package # hide me from search.cpan.org
32 Moose::Meta::Attribute::Custom::Trait::Collection::Bag;
33 sub register_implementation {
34 'Moose::AttributeHelpers::Trait::Collection::Bag'
45 Moose::AttributeHelpers::Collection::Bag
51 use Moose::AttributeHelpers;
53 has 'word_histogram' => (
54 metaclass => 'Collection::Bag',
56 isa => 'Bag', # optional ... as is defalt
59 get_count_for => 'get',
60 has_any_words => 'empty',
62 delete_word => 'delete',
68 This module provides a Bag attribute which provides a number of
69 bag-like operations. See L<Moose::AttributeHelpers::MethodProvider::Bag>
78 =item B<method_provider>
80 =item B<has_method_provider>
84 =item B<process_options_for_handles>
90 All complex software has bugs lurking in it, and this module is no
91 exception. If you find a bug please either email me, or add the bug
96 Stevan Little E<lt>stevan@iinteractive.comE<gt>
98 =head1 COPYRIGHT AND LICENSE
100 Copyright 2007-2009 by Infinity Interactive, Inc.
102 L<http://www.iinteractive.com>
104 This library is free software; you can redistribute it and/or modify
105 it under the same terms as Perl itself.