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;
=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 { [] },
=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
=head1 COPYRIGHT AND LICENSE
-Copyright 2007 by Infinity Interactive, Inc.
+Copyright 2007-2008 by Infinity Interactive, Inc.
L<http://www.iinteractive.com>