package MooseX::AttributeHelpers::Collection;
use Moose;
-use Moose::Util::TypeConstraints;
-our $VERSION = '0.01';
+our $VERSION = '0.16';
+$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
extends 'MooseX::AttributeHelpers::Base';
-has 'container_type' => (
- is => 'ro',
- isa => 'Str',
- predicate => 'has_container_type',
-);
-
-has 'container_type_constraint' => (
- is => 'rw',
- isa => 'Moose::Meta::TypeConstraint',
- lazy => 1,
- default => sub {
- my $self = shift;
- ($self->has_container_type)
- || confess "You cannot create a container_type_constraint if you dont have a container type";
-
- my $container_type = $self->container_type;
- my $constraint = find_type_constraint($container_type);
-
- $constraint = subtype('Object', where { $_->isa($container_type) })
- unless $constraint;
-
- return $constraint;
- }
-);
-
-before 'process_options_for_provides' => sub {
- my ($self, $options) = @_;
-
- if (exists $options->{isa}) {
- my $type = $options->{isa};
- if ($type =~ /^(.*)\[(.*)\]$/) {
- my $core_type = $1;
- my $container_type = $2;
- $options->{isa} = $core_type;
- $options->{container_type} = $container_type;
- }
- }
-};
-
no Moose;
1;
=head1 NAME
-=head1 SYNOPSIS
+MooseX::AttributeHelpers::Collection - Base class for all collection type helpers
=head1 DESCRIPTION
+Documentation to come.
+
=head1 METHODS
+=over 4
+
+=item B<meta>
+
+=item B<container_type>
+
+=item B<container_type_constraint>
+
+=item B<has_container_type>
+
+=item B<process_options_for_provides>
+
+=back
+
=head1 BUGS
All complex software has bugs lurking in it, and this module is no
=head1 COPYRIGHT AND LICENSE
-Copyright 2007 by Infinity Interactive, Inc.
+Copyright 2007-2008 by Infinity Interactive, Inc.
L<http://www.iinteractive.com>