add a delegation_metaclass method to MM::Attribute, rather than hard-coding a class...
Dave Rolsky [Fri, 23 Jan 2009 17:48:00 +0000 (17:48 +0000)]
Changes
lib/Moose/Meta/Attribute.pm

diff --git a/Changes b/Changes
index 286c550..750ed11 100644 (file)
--- a/Changes
+++ b/Changes
@@ -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
index d5dc685..2c85617 100644 (file)
@@ -705,6 +705,8 @@ sub _get_delegate_method_list {
     }
 }
 
+sub delegation_metaclass { 'Moose::Meta::Method::Delegation' }
+
 sub _make_delegation_method {
     my ( $self, $handle_name, $method_to_call ) = @_;
 
@@ -713,7 +715,7 @@ sub _make_delegation_method {
     $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 @@ will behave just as L<Class::MOP::Attribute> does.
 
 =item B<accessor_metaclass>
 
+=item B<delegation_metaclass>
+
 =item B<get_value>
 
 =item B<set_value>