X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FAttributeHelpers%2FCollection%2FArray.pm;h=47e7b90359eb3020d89355cbc78ece656d7f7338;hb=e993b282cf63b60c6c52987cd9f6ac93a27eba22;hp=4bf17ca26c964981883820a33cce2f24b8c91c01;hpb=b9dc8e2f66cb0c06a8d52aaa3b4734237b749b20;p=gitmo%2FMooseX-AttributeHelpers.git diff --git a/lib/MooseX/AttributeHelpers/Collection/Array.pm b/lib/MooseX/AttributeHelpers/Collection/Array.pm index 4bf17ca..47e7b90 100644 --- a/lib/MooseX/AttributeHelpers/Collection/Array.pm +++ b/lib/MooseX/AttributeHelpers/Collection/Array.pm @@ -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. =head1 BUGS @@ -63,7 +66,7 @@ Stevan Little Estevan@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2007 by Infinity Interactive, Inc. +Copyright 2007-2008 by Infinity Interactive, Inc. L