2 package MooseX::AttributeHelpers::Collection::Bag;
4 use Moose::Util::TypeConstraints;
5 use MooseX::AttributeHelpers::Sugar;
8 our $AUTHORITY = 'cpan:STEVAN';
10 extends 'MooseX::AttributeHelpers::Collection';
12 subtype 'Bag' => as 'HashRef[Int]';
14 define_attribute_helper (
15 default_options => { default => sub { {} } },
17 method_provider => 'MooseX::AttributeHelpers::MethodProvider::Bag',
18 shortcut => 'Collection::Bag',
22 no Moose::Util::TypeConstraints;
23 no MooseX::AttributeHelpers::Sugar;
33 MooseX::AttributeHelpers::Collection::Bag
39 use MooseX::AttributeHelpers;
41 has 'word_histogram' => (
42 metaclass => 'Collection::Bag',
44 isa => 'Bag', # optional ... as is defalt
47 'get' => 'get_count_for',
48 'empty' => 'has_any_words',
49 'count' => 'num_words',
50 'delete' => 'delete_word',
56 This module provides a Bag attribute which provides a number of
57 bag-like operations. See L<MooseX::AttributeHelpers::MethodProvider::Bag>
60 =head1 PROVIDED METHODS
62 The methods for this metaclass are provided by
63 L<MooseX::AttributeHelpers::MethodProvider::Bag>.
67 All complex software has bugs lurking in it, and this module is no
68 exception. If you find a bug please either email me, or add the bug
73 Stevan Little E<lt>stevan@iinteractive.comE<gt>
75 =head1 COPYRIGHT AND LICENSE
77 Copyright 2007-2008 by Infinity Interactive, Inc.
79 L<http://www.iinteractive.com>
81 This library is free software; you can redistribute it and/or modify
82 it under the same terms as Perl itself.