From: Stevan Little Date: Mon, 6 Mar 2006 04:34:44 +0000 (+0000) Subject: fucking attributes dont work right ,... damn you perl,.. damn you X-Git-Tag: 0_05~112 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3c7278fb02caba8c91dc7e43a6d29d7a96a0c483;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 ab122e3..4d4b01f 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -34,6 +34,21 @@ sub import { %options, )); }); + + $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->superclasses('Moose::Object') unless $meta->superclasses(); @@ -79,6 +94,14 @@ Moose - =head1 OTHER NAMES +Makes Other Object Systems Envious + +Most Other Objects Suck Eggs + +Makes Object Orientation So Easy + +Metacircular Object Oriented Systems Environment + =head1 BUGS All complex software has bugs lurking in it, and this module is no diff --git a/t/001_basic.t b/t/001_basic.t index 6bf6887..36cf310 100644 --- a/t/001_basic.t +++ b/t/001_basic.t @@ -29,11 +29,10 @@ BEGIN { has '$:z'; - sub clear { + after 'clear' => sub { my $self = shift; - $self->SUPER::clear(); $self->{'$:z'} = 0; - } + }; }