Hmm. I think I did something odd in here...
[gitmo/MooseX-AttributeHelpers.git] / lib / MooseX / AttributeHelpers / Collection / Array.pm
index 4bf17ca..47e7b90 100644 (file)
@@ -1,27 +1,21 @@
 
 package MooseX::AttributeHelpers::Collection::Array;
 use Moose;
-use Moose::Util::TypeConstraints;
+use MooseX::AttributeHelpers::Sugar;
+
+extends 'MooseX::AttributeHelpers::Collection';
 
 our $VERSION   = '0.01';
 our $AUTHORITY = 'cpan:STEVAN';
 
-use MooseX::AttributeHelpers::MethodProvider::Array;
-
-extends 'MooseX::AttributeHelpers::Collection';
-
-has '+method_provider' => (
-    default => 'MooseX::AttributeHelpers::MethodProvider::Array'
+define_attribute_helper (
+    helper_type      => 'ArrayRef',
+    method_provider  => 'MooseX::AttributeHelpers::MethodProvider::Array',
+    shortcut         => 'Collection::Array',
 );
 
-sub helper_type { 'ArrayRef' }
-
 no Moose;
-
-# register the alias ...
-package Moose::Meta::Attribute::Custom::Collection::Array;
-sub register_implementation { 'MooseX::AttributeHelpers::Collection::Array' }
-
+no MooseX::AttributeHelpers::Sugar;
 
 1;
 
@@ -31,13 +25,16 @@ __END__
 
 =head1 NAME
 
+MooseX::AttributeHelpers::Collection::Array
+
 =head1 SYNOPSIS
 
   package Stuff;
   use Moose;
+  use MooseX::AttributeHelpers;
   
   has 'options' => (
-      metaclass => 'Collection',
+      metaclass => 'Collection::Array',
       is        => 'ro',
       isa       => 'ArrayRef[Int]',
       default   => sub { [] },
@@ -49,7 +46,13 @@ __END__
 
 =head1 DESCRIPTION
 
-=head1 METHODS
+This module provides an Array attribute which provides a number of 
+array operations. 
+
+=head1 PROVIDED METHODS
+
+The methods for this metaclass are provided by
+L<MooseX::AttributeHelpers::MethodProvider::Array>.
 
 =head1 BUGS
 
@@ -63,7 +66,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>