X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FMethod.pm;h=55da7267e9dd4c0ba723ebb6199773b2d82e941b;hb=6a7756cc831fa21bc28b924a8edbaeeb28a4a66b;hp=54b6d07b6b865a238b43036c8e66e55902f92650;hpb=267711f78bd79835875f805447d3ab802a18f0c4;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Method.pm b/lib/Mouse/Meta/Method.pm old mode 100755 new mode 100644 index 54b6d07..55da726 --- a/lib/Mouse/Meta/Method.pm +++ b/lib/Mouse/Meta/Method.pm @@ -1,14 +1,17 @@ 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, ; -sub wrap{ +sub wrap { my $class = shift; - + unshift @_, 'body' if @_ % 2 != 0; return $class->_new(@_); } @@ -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.4501 +This document describes Mouse version 0.78 + +=head1 DESCRIPTION + +This class is a meta object protocol for Mouse methods, +which is a subset of Moose::Meta:::Method. =head1 SEE ALSO