X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FMethod.pm;h=3802b196373bc51c8d767a34f1c5249bf587d572;hb=f15e804113bd71c954a90ffe44ced6ee2b762c4e;hp=4d6e2224ea488699d6edf995f33df520cff7b6ae;hpb=8c235ea79c109c704514acd56b10265220499d70;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Method.pm b/lib/Mouse/Meta/Method.pm index 4d6e222..3802b19 100755 --- a/lib/Mouse/Meta/Method.pm +++ b/lib/Mouse/Meta/Method.pm @@ -1,7 +1,10 @@ package Mouse::Meta::Method; use Mouse::Util qw(:meta); # enables strict and warnings +use Scalar::Util (); use overload + '==' => '_equal', + 'eq' => '_equal', '&{}' => sub{ $_[0]->body }, fallback => 1, ; @@ -32,6 +35,16 @@ sub fully_qualified_name { return $self->package_name . '::' . $self->name; } +# for Moose compat +sub _equal { + my($l, $r) = @_; + + return Scalar::Util::blessed($r) + && $l->body == $r->body + && $l->name eq $r->name + && $l->package_name eq $r->package_name; +} + 1; __END__ @@ -41,7 +54,7 @@ Mouse::Meta::Method - A Mouse Method metaclass =head1 VERSION -This document describes Mouse version 0.46 +This document describes Mouse version 0.56 =head1 SEE ALSO