Commit | Line | Data |
9a976497 |
1 | package MooseX::AttributeHelpers::Collection::Bag; |
2 | use Moose; |
786dbc3d |
3 | use MooseX::AttributeHelpers::MethodProvider::Collection::Bag; |
9a976497 |
4 | |
5 | our $VERSION = '0.01'; |
6 | our $AUTHORITY = 'cpan:STEVAN'; |
7 | |
9a976497 |
8 | extends 'MooseX::AttributeHelpers::Collection'; |
9 | |
786dbc3d |
10 | __PACKAGE__->sugar( |
e993b282 |
11 | default_options => { default => sub { {} } }, |
786dbc3d |
12 | method_provider => 'Collection::Bag', |
e993b282 |
13 | shortcut => 'Collection::Bag', |
14 | ); |
9a976497 |
15 | |
16 | no Moose; |
9a976497 |
17 | |
18 | 1; |
19 | |
20 | __END__ |
21 | |
22 | =pod |
23 | |
24 | =head1 NAME |
25 | |
26 | MooseX::AttributeHelpers::Collection::Bag |
27 | |
28 | =head1 SYNOPSIS |
29 | |
30 | package Stuff; |
31 | use Moose; |
32 | use MooseX::AttributeHelpers; |
33 | |
34 | has 'word_histogram' => ( |
35 | metaclass => 'Collection::Bag', |
36 | is => 'ro', |
37 | isa => 'Bag', # optional ... as is defalt |
38 | provides => { |
39 | 'add' => 'add_word', |
40 | 'get' => 'get_count_for', |
41 | 'empty' => 'has_any_words', |
42 | 'count' => 'num_words', |
43 | 'delete' => 'delete_word', |
44 | } |
45 | ); |
46 | |
47 | =head1 DESCRIPTION |
48 | |
49 | This module provides a Bag attribute which provides a number of |
50 | bag-like operations. See L<MooseX::AttributeHelpers::MethodProvider::Bag> |
51 | for more details. |
52 | |
e993b282 |
53 | =head1 PROVIDED METHODS |
9a976497 |
54 | |
e993b282 |
55 | The methods for this metaclass are provided by |
56 | L<MooseX::AttributeHelpers::MethodProvider::Bag>. |
9a976497 |
57 | |
58 | =head1 BUGS |
59 | |
60 | All complex software has bugs lurking in it, and this module is no |
61 | exception. If you find a bug please either email me, or add the bug |
62 | to cpan-RT. |
63 | |
64 | =head1 AUTHOR |
65 | |
66 | Stevan Little E<lt>stevan@iinteractive.comE<gt> |
67 | |
68 | =head1 COPYRIGHT AND LICENSE |
69 | |
99c62fb8 |
70 | Copyright 2007-2008 by Infinity Interactive, Inc. |
9a976497 |
71 | |
72 | L<http://www.iinteractive.com> |
73 | |
74 | This library is free software; you can redistribute it and/or modify |
75 | it under the same terms as Perl itself. |
76 | |
e993b282 |
77 | =cut |