From: Shawn M Moore Date: Sun, 25 May 2008 01:21:48 +0000 (+0000) Subject: MooseX::AttributeHelpers::Trait::Collection (which is just as empty as MX:AH::Collection) X-Git-Tag: 0.18_01~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0f1a45c1e52bbf806290ef2df355e48b0848181d;p=gitmo%2FMooseX-AttributeHelpers.git MooseX::AttributeHelpers::Trait::Collection (which is just as empty as MX:AH::Collection) --- diff --git a/lib/MooseX/AttributeHelpers/Trait/Collection.pm b/lib/MooseX/AttributeHelpers/Trait/Collection.pm new file mode 100644 index 0000000..8b836a6 --- /dev/null +++ b/lib/MooseX/AttributeHelpers/Trait/Collection.pm @@ -0,0 +1,62 @@ + +package MooseX::AttributeHelpers::Trait::Collection; +use Moose::Role; + +our $VERSION = '0.03'; +our $AUTHORITY = 'cpan:STEVAN'; + +with 'MooseX::AttributeHelpers::Trait::Base'; + +no Moose::Role; + +1; + +__END__ + +=pod + +=head1 NAME + +MooseX::AttributeHelpers::Collection - Base class for all collection type helpers + +=head1 DESCRIPTION + +Documentation to come. + +=head1 METHODS + +=over 4 + +=item B + +=item B + +=item B + +=item B + +=item B + +=back + +=head1 BUGS + +All complex software has bugs lurking in it, and this module is no +exception. If you find a bug please either email me, or add the bug +to cpan-RT. + +=head1 AUTHOR + +Stevan Little Estevan@iinteractive.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright 2007-2008 by Infinity Interactive, Inc. + +L + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + diff --git a/lib/MooseX/AttributeHelpers/Trait/Collection/List.pm b/lib/MooseX/AttributeHelpers/Trait/Collection/List.pm new file mode 100644 index 0000000..072fb25 --- /dev/null +++ b/lib/MooseX/AttributeHelpers/Trait/Collection/List.pm @@ -0,0 +1,93 @@ + +package MooseX::AttributeHelpers::Trait::Collection::List; +use Moose::Role; + +our $VERSION = '0.01'; +our $AUTHORITY = 'cpan:STEVAN'; + +use MooseX::AttributeHelpers::MethodProvider::List; + +with 'MooseX::AttributeHelpers::Trait::Collection'; + +has '+method_provider' => ( + default => 'MooseX::AttributeHelpers::MethodProvider::List' +); + +sub helper_type { 'ArrayRef' } + +no Moose; + +# register the alias ... +package # hide me from search.cpan.org + Moose::Meta::Attribute::Custom::Collection::List; +sub register_implementation { 'MooseX::AttributeHelpers::Collection::List' } + + +1; + +__END__ + +=pod + +=head1 NAME + +MooseX::AttributeHelpers::Collection::List + +=head1 SYNOPSIS + + package Stuff; + use Moose; + use MooseX::AttributeHelpers; + + has 'options' => ( + metaclass => 'Collection::List', + is => 'ro', + isa => 'ArrayRef[Int]', + default => sub { [] }, + provides => { + map => 'map_options', + grep => 'fitler_options', + } + ); + +=head1 DESCRIPTION + +This module provides an List attribute which provides a number of +list operations. See L +for more details. + +=head1 METHODS + +=over 4 + +=item B + +=item B + +=item B + +=item B + +=back + +=head1 BUGS + +All complex software has bugs lurking in it, and this module is no +exception. If you find a bug please either email me, or add the bug +to cpan-RT. + +=head1 AUTHOR + +Stevan Little Estevan@iinteractive.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright 2007-2008 by Infinity Interactive, Inc. + +L + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut +