Bump to 0.13
[gitmo/MooseX-AttributeHelpers.git] / lib / MooseX / AttributeHelpers / Collection.pm
index d821b15..6da3f04 100644 (file)
@@ -1,60 +1,13 @@
 
 package MooseX::AttributeHelpers::Collection;
 use Moose;
-use Moose::Util::TypeConstraints;
 
-our $VERSION   = '0.01';
+our $VERSION   = '0.13';
 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);
-
-        # NOTE:
-        # I am not sure DWIM-ery is a good thing
-        # here, so i am going to err on the side 
-        # of caution, and blow up if you have
-        # not made a type constraint for this yet.
-        # - SL
-        (defined $constraint)
-            || confess "You must predefine the '$container_type' constraint before you can use it as a container type";
-        
-        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;
-no Moose::Util::TypeConstraints;
 
 1;
 
@@ -64,12 +17,28 @@ __END__
 
 =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 
@@ -82,7 +51,7 @@ Stevan Little E<lt>stevan@iinteractive.comE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2007 by Infinity Interactive, Inc.
+Copyright 2007-2008 by Infinity Interactive, Inc.
 
 L<http://www.iinteractive.com>