diff options
author | doy <doy@tozt.net> | 2008-12-06 23:11:06 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2008-12-06 23:11:06 -0500 |
commit | fe814d63a053867c38e9b22c449475ea1573f02e (patch) | |
tree | b91941f2af415ed8c3e63e2bc666e830221dfbcf /lib | |
parent | 108c4ab3669e263875df3fb68dc8e2edf7783ef2 (diff) | |
download | moosex-role-matcher-fe814d63a053867c38e9b22c449475ea1573f02e.tar.gz moosex-role-matcher-fe814d63a053867c38e9b22c449475ea1573f02e.zip |
add all_match
Diffstat (limited to 'lib')
-rw-r--r-- | lib/MooseX/Role/Matcher.pm | 7 |
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; |