Fix the API for set_value; even though we don't need the instance we still have to...
Shawn M Moore [Mon, 10 Nov 2008 22:23:30 +0000 (22:23 +0000)]
lib/MooseX/ClassAttribute/Role/Meta/Attribute.pm

index 70052cb..ee3d344 100644 (file)
@@ -56,14 +56,15 @@ around 'detach_from_class' => sub
 sub _initialize
 {
     my $self = shift;
+    my $class_name = $self->associated_class()->name();
 
     if ( $self->has_default() )
     {
-        $self->set_value( $self->default() );
+        $self->set_value( $class_name, $self->default() );
     }
     elsif ( $self->has_builder() )
     {
-        $self->set_value( $self->_call_builder() );
+        $self->set_value( $class_name, $self->_call_builder() );
     }
 }
 
@@ -103,8 +104,9 @@ around '_call_builder' => sub
 around 'set_value' => sub
 {
     shift;
-    my $self  = shift;
-    my $value = shift;
+    my $self     = shift;
+    my $instance = shift;
+    my $value    = shift;
 
     $self->associated_class()->set_class_attribute_value( $self->name() => $value );
 };