From e46636b5dc36ea452cbe97e371a5003728a2b644 Mon Sep 17 00:00:00 2001 From: doy Date: Mon, 12 Jan 2009 22:54:36 -0500 Subject: implement submatching --- lib/MooseX/Role/Matcher.pm | 5 +++++ 1 file changed, 5 insertions(+) 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; }; -- cgit v1.2.3