[Moose-commits] r7382 - in Moose/trunk: . lib/Moose/Meta

autarch at code2.0beta.co.uk autarch at code2.0beta.co.uk
Fri Jan 23 17:48:01 GMT 2009


Author: autarch
Date: 2009-01-23 09:48:00 -0800 (Fri, 23 Jan 2009)
New Revision: 7382

Modified:
   Moose/trunk/Changes
   Moose/trunk/lib/Moose/Meta/Attribute.pm
Log:
add a delegation_metaclass method to MM::Attribute, rather than hard-coding a class name


Modified: Moose/trunk/Changes
===================================================================
--- Moose/trunk/Changes	2009-01-23 10:42:25 UTC (rev 7381)
+++ Moose/trunk/Changes	2009-01-23 17:48:00 UTC (rev 7382)
@@ -1,5 +1,10 @@
 Revision history for Perl extension Moose
 
+0.66
+    * Moose::Meta::Attribute
+      - Added a delegation_metaclass method to replace a hard-coded
+        use of Moose::Meta::Method::Delegation. (Dave Rolsky)
+
 0.65 Thu, January 22, 2008
     * Moose and Moose::Meta::Method::Overridden
       - If an overridden method called super(), and then the

Modified: Moose/trunk/lib/Moose/Meta/Attribute.pm
===================================================================
--- Moose/trunk/lib/Moose/Meta/Attribute.pm	2009-01-23 10:42:25 UTC (rev 7381)
+++ Moose/trunk/lib/Moose/Meta/Attribute.pm	2009-01-23 17:48:00 UTC (rev 7382)
@@ -705,6 +705,8 @@
     }
 }
 
+sub delegation_metaclass { 'Moose::Meta::Method::Delegation' }
+
 sub _make_delegation_method {
     my ( $self, $handle_name, $method_to_call ) = @_;
 
@@ -713,7 +715,7 @@
     $method_body = $method_to_call
         if 'CODE' eq ref($method_to_call);
 
-    return Moose::Meta::Method::Delegation->new(
+    return $self->delegation_metaclass->new(
         name               => $handle_name,
         package_name       => $self->associated_class->name,
         attribute          => $self,
@@ -787,6 +789,8 @@
 
 =item B<accessor_metaclass>
 
+=item B<delegation_metaclass>
+
 =item B<get_value>
 
 =item B<set_value>




More information about the Moose-commits mailing list