From fe814d63a053867c38e9b22c449475ea1573f02e Mon Sep 17 00:00:00 2001 From: doy Date: Sat, 6 Dec 2008 23:11:06 -0500 Subject: add all_match --- lib/MooseX/Role/Matcher.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') 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; -- cgit v1.2.3-54-g00ecf