X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FAttributeHelpers%2FCollection%2FBag.pm;h=26670f5bb23c1e36adbad05a7768f616be8c0eab;hb=2e74144c8801485e5c33fdcdcbee9f7d882c1a3a;hp=607b1fd8c975762d421887f7cb89e87a653fa2b6;hpb=1ccccb1f899425f1da631506c0a8370df9419e5c;p=gitmo%2FMooseX-AttributeHelpers.git diff --git a/lib/MooseX/AttributeHelpers/Collection/Bag.pm b/lib/MooseX/AttributeHelpers/Collection/Bag.pm index 607b1fd..26670f5 100644 --- a/lib/MooseX/AttributeHelpers/Collection/Bag.pm +++ b/lib/MooseX/AttributeHelpers/Collection/Bag.pm @@ -1,36 +1,15 @@ package MooseX::AttributeHelpers::Collection::Bag; use Moose; -use Moose::Util::TypeConstraints; -our $VERSION = '0.11'; +our $VERSION = '0.23'; +$VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -use MooseX::AttributeHelpers::MethodProvider::Bag; - -extends 'MooseX::AttributeHelpers::Collection'; - -has '+method_provider' => ( - default => 'MooseX::AttributeHelpers::MethodProvider::Bag' -); - -subtype 'Bag' => as 'HashRef[Int]'; - -sub helper_type { 'Bag' } - -before 'process_options_for_provides' => sub { - my ($self, $options, $name) = @_; - - # Set some default attribute options here unless already defined - if ((my $type = $self->helper_type) && !exists $options->{isa}){ - $options->{isa} = $type; - } - - $options->{default} = sub { +{} } unless exists $options->{default}; -}; +extends 'Moose::Meta::Attribute'; +with 'MooseX::AttributeHelpers::Trait::Collection::Bag'; no Moose; -no Moose::Util::TypeConstraints; # register the alias ... package # hide me from search.cpan.org @@ -56,7 +35,7 @@ MooseX::AttributeHelpers::Collection::Bag has 'word_histogram' => ( metaclass => 'Collection::Bag', is => 'ro', - isa => 'Bag', # optional ... as is defalt + isa => 'Bag', # optional ... as is default provides => { 'add' => 'add_word', 'get' => 'get_count_for', @@ -100,7 +79,7 @@ Stevan Little Estevan@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2007-2008 by Infinity Interactive, Inc. +Copyright 2007-2009 by Infinity Interactive, Inc. L