1 package MooseX::AttributeHelpers::MethodProvider::List;
5 our $AUTHORITY = 'cpan:STEVAN';
8 my ($attr, $reader, $writer) = @_;
10 scalar @{$reader->($_[0])}
15 my ($attr, $reader, $writer) = @_;
17 scalar @{$reader->($_[0])} ? 1 : 0
22 my ($attr, $reader, $writer) = @_;
24 my ($instance, $predicate) = @_;
25 foreach my $val (@{$reader->($instance)}) {
26 return $val if $predicate->($val);
33 my ($attr, $reader, $writer) = @_;
35 my ($instance, $f) = @_;
36 CORE::map { $f->($_) } @{$reader->($instance)}
41 my ($attr, $reader, $writer) = @_;
43 my ($instance, $predicate) = @_;
44 CORE::grep { $predicate->($_) } @{$reader->($instance)}
56 MooseX::AttributeHelpers::MethodProvider::List
60 This is a role which provides the method generators for
61 L<MooseX::AttributeHelpers::Collection::List>.
71 =head1 PROVIDED METHODS
89 All complex software has bugs lurking in it, and this module is no
90 exception. If you find a bug please either email me, or add the bug
95 Stevan Little E<lt>stevan@iinteractive.comE<gt>
97 =head1 COPYRIGHT AND LICENSE
99 Copyright 2007-2008 by Infinity Interactive, Inc.
101 L<http://www.iinteractive.com>
103 This library is free software; you can redistribute it and/or modify
104 it under the same terms as Perl itself.