summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-01-12 22:54:36 -0500
committerdoy <doy@tozt.net>2009-01-12 22:54:36 -0500
commite46636b5dc36ea452cbe97e371a5003728a2b644 (patch)
tree55e9e37280022265795df4910d62f352f56461f4
parentcf05eeb09e4366d7848fb35c1597633f28b4d196 (diff)
downloadmoosex-role-matcher-e46636b5dc36ea452cbe97e371a5003728a2b644.tar.gz
moosex-role-matcher-e46636b5dc36ea452cbe97e371a5003728a2b644.zip
implement submatching
-rw-r--r--lib/MooseX/Role/Matcher.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/MooseX/Role/Matcher.pm b/lib/MooseX/Role/Matcher.pm
index ce8ebd3..3080348 100644
--- a/lib/MooseX/Role/Matcher.pm
+++ b/lib/MooseX/Role/Matcher.pm
@@ -169,6 +169,11 @@ method _match => sub {
return 1 if $self->_match($value => $_);
}
}
+ if (ref($seek) eq 'HASH') {
+ return 0 unless blessed($value) &&
+ $value->does('MooseX::Role::Matcher');
+ return $value->match(%$seek);
+ }
return $value eq $seek;
};