ChangeLog and adding yuval to authors everywhere
[gitmo/Class-MOP.git] / examples / InstanceCountingClass.pod
index da80038..d0274e7 100644 (file)
@@ -5,7 +5,7 @@ package # hide the package from PAUSE
 use strict;
 use warnings;
 
-our $VERSION = '0.02';
+our $VERSION = '0.03';
 
 use base 'Class::MOP::Class';
 
@@ -14,11 +14,10 @@ InstanceCountingClass->meta->add_attribute('$:count' => (
     default => 0
 ));
 
-sub construct_instance {
-    my ($class, %params) = @_;
-    $class->{'$:count'}++;
-    return $class->SUPER::construct_instance(%params);
-}
+InstanceCountingClass->meta->add_before_method_modifier('construct_instance' => sub {
+    my ($class) = @_;
+    $class->{'$:count'}++;     
+});
 
 1;
 
@@ -56,10 +55,12 @@ InstanceCountingClass - An example metaclass which counts instances
 This is a classic example of a metaclass which keeps a count of each 
 instance which is created. 
 
-=head1 AUTHOR
+=head1 AUTHORS
 
 Stevan Little E<lt>stevan@iinteractive.comE<gt>
 
+Yuval Kogman E<lt>nothingmuch@woobling.comE<gt>
+
 =head1 COPYRIGHT AND LICENSE
 
 Copyright 2006 by Infinity Interactive, Inc.