Adding better attribute/method metaclass handling
[gitmo/Class-MOP.git] / examples / InsideOutClass.pod
index b371c15..73b0262 100644 (file)
@@ -34,8 +34,6 @@ sub construct_instance {
     return $instance;
 }
 
-sub attribute_metaclass { 'InsideOutClass::Attribute' }
-
 package # hide the package from PAUSE
     InsideOutClass::Attribute;
 
@@ -96,7 +94,14 @@ InsideOutClass - A set of example metaclasses which implement the Inside-Out tec
 
   package Foo;
   
-  sub meta { InsideOutClass->initialize($_[0]) }
+  sub meta { 
+      InsideOutClass->initialize($_[0] => (
+         # tell our metaclass to use the 
+         # InsideOut attribute metclass 
+         # to construct all it's attributes
+        ':attribute_metaclass' => 'InsideOutClass::Attribute'
+      )) 
+  }
   
   __PACKAGE__->meta->add_attribute('foo' => (
       reader => 'get_foo',