X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FMethod.pm;h=33c17acf53c97ed39825d7c83848159b0647a5fc;hb=d686eec5998e18a15198c9f333954bd6761e8258;hp=73973d191819a544e7d8296372770e32a0dc80ca;hpb=a4cbb3cb944aa43521dfa69a9f04b206c6b7a6ea;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Method.pm b/lib/Mouse/Meta/Method.pm index 73973d1..33c17ac 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,12 @@ Mouse::Meta::Method - A Mouse Method metaclass =head1 VERSION -This document describes Mouse version 0.44 +This document describes Mouse version 0.68 + +=head1 DESCRIPTION + +This class is a meta object protocol for Mouse methods, +which is a subset of Moose::Meta:::Method. =head1 SEE ALSO