X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=examples%2FPerl6Attribute.pod;h=e03eb7120f36e88692c1c3a44a5986a541d7eaf4;hb=28a82ddae9835be042c809198885582ba32b9583;hp=2daffca1d1ed027051def5bcd0718eb45423175b;hpb=aa448b163f4882fc3e4b92a1c1f22e3c9ad9f933;p=gitmo%2FClass-MOP.git diff --git a/examples/Perl6Attribute.pod b/examples/Perl6Attribute.pod index 2daffca..e03eb71 100644 --- a/examples/Perl6Attribute.pod +++ b/examples/Perl6Attribute.pod @@ -5,11 +5,12 @@ package # hide the package from PAUSE use strict; use warnings; -our $VERSION = '0.01'; +our $VERSION = '0.02'; use base 'Class::MOP::Attribute'; -sub new { +Perl6Attribute->meta->add_around_method_modifier('new' => sub { + my $cont = shift; my ($class, $attribute_name, %options) = @_; # extract the sigil and accessor name @@ -22,8 +23,8 @@ sub new { $options{default} = sub { [] } if ($sigil eq '@'); $options{default} = sub { {} } if ($sigil eq '%'); - $class->SUPER::new($attribute_name, %options); -} + $cont->($class, $attribute_name, %options); +}); 1; @@ -64,13 +65,15 @@ same pre-processing approach. This is left as an exercise to the reader though (if you do it, please send me a patch though, and will update this). -=head1 AUTHOR +=head1 AUTHORS Stevan Little Estevan@iinteractive.comE +Yuval Kogman Enothingmuch@woobling.comE + =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006-2008 by Infinity Interactive, Inc. L