From: Stevan Little Date: Mon, 6 Mar 2006 05:35:43 +0000 (+0000) Subject: fucking attributes dont work right ,... damn you perl,.. damn you X-Git-Tag: 0_05~111 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=09fdc1dc65c8f45b8c6761948b6adf5045e29cd2;p=gitmo%2FMoose.git fucking attributes dont work right ,... damn you perl,.. damn you --- diff --git a/lib/Moose.pm b/lib/Moose.pm index 4d4b01f..6067f2a 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -35,20 +35,9 @@ sub import { )); }); - $meta->alias_method('before' => sub { - my ($name, $code) = @_; - $meta->add_before_method_modifier($name, $code); - }); - - $meta->alias_method('after' => sub { - my ($name, $code) = @_; - $meta->add_after_method_modifier($name, $code); - }); - - $meta->alias_method('around' => sub { - my ($name, $code) = @_; - $meta->add_around_method_modifier($name, $code); - }); + $meta->alias_method('before' => sub { $meta->add_before_method_modifier(@_) }); + $meta->alias_method('after' => sub { $meta->add_after_method_modifier(@_) }); + $meta->alias_method('around' => sub { $meta->add_around_method_modifier(@_) }); $meta->superclasses('Moose::Object') unless $meta->superclasses(); @@ -69,27 +58,27 @@ Moose - package Point; use Moose; - has '$.x'; - has '$.y' => (is => 'rw'); + has '$.x' => (reader => 'x'); + has '$.y' => (accessor => 'y'); sub clear { my $self = shift; - $self->x(0); + $self->{'$.x'} = 0; $self->y(0); } - package Point::3D; + package Point3D; use Moose; use base 'Point'; has '$:z'; - sub clear : After { + after 'clear' => sub { my $self = shift; $self->{'$:z'} = 0; - } - + }; + =head1 DESCRIPTION =head1 OTHER NAMES