summaryrefslogtreecommitdiffstats
path: root/lib/MooseX
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2008-12-06 23:11:06 -0500
committerdoy <doy@tozt.net>2008-12-06 23:11:06 -0500
commitfe814d63a053867c38e9b22c449475ea1573f02e (patch)
treeb91941f2af415ed8c3e63e2bc666e830221dfbcf /lib/MooseX
parent108c4ab3669e263875df3fb68dc8e2edf7783ef2 (diff)
downloadmoosex-role-matcher-fe814d63a053867c38e9b22c449475ea1573f02e.tar.gz
moosex-role-matcher-fe814d63a053867c38e9b22c449475ea1573f02e.zip
add all_match
Diffstat (limited to 'lib/MooseX')
-rw-r--r--lib/MooseX/Role/Matcher.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/MooseX/Role/Matcher.pm b/lib/MooseX/Role/Matcher.pm
index d4731cc..0bb4ce0 100644
--- a/lib/MooseX/Role/Matcher.pm
+++ b/lib/MooseX/Role/Matcher.pm
@@ -2,7 +2,7 @@
package MooseX::Role::Matcher;
use MooseX::Role::Parameterized;
use List::Util qw/first/;
-use List::MoreUtils qw/any/;
+use List::MoreUtils qw/any all/;
parameter default_match => (
is => 'ro',
@@ -38,6 +38,11 @@ method any_match => sub {
$class->_apply_to_matches(\&any, @_);
};
+method all_match => sub {
+ my $class = shift;
+ $class->_apply_to_matches(\&all, @_);
+};
+
method _match => sub {
my $self = shift;
my $value = shift;