X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FMethod.pm;h=9ba243ea5a02bb23f064e04e730fb51bc62d95a4;hb=e78cd29d5fc15e8772735b0e4691549dd685d689;hp=f800ff03294c2b9bdfd0863a62ea1a801ed1bdaa;hpb=9010458d614641c8103b1d06b479e0c80aa1dcda;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Method.pm b/lib/Mouse/Meta/Method.pm index f800ff0..9ba243e 100755 --- a/lib/Mouse/Meta/Method.pm +++ b/lib/Mouse/Meta/Method.pm @@ -2,7 +2,7 @@ package Mouse::Meta::Method; use Mouse::Util qw(:meta); # enables strict and warnings use overload - '&{}' => 'body', + '&{}' => sub{ $_[0]->body }, fallback => 1, ; @@ -13,11 +13,13 @@ sub wrap{ } sub _new{ - my $class = shift; - return $class->meta->new_object(@_) - if $class ne __PACKAGE__; + my($class, %args) = @_; + my $self = bless \%args, $class; - return bless {@_}, $class; + if($class ne __PACKAGE__){ + $self->meta->_initialize_object($self, \%args); + } + return $self; } sub body { $_[0]->{body} } @@ -39,7 +41,7 @@ Mouse::Meta::Method - A Mouse Method metaclass =head1 VERSION -This document describes Mouse version 0.40 +This document describes Mouse version 0.40_08 =head1 SEE ALSO