Add bootstrapping code for insertion_order in Attribute.pm
nperez [Fri, 8 May 2009 18:08:23 +0000 (13:08 -0500)]
lib/Class/MOP.pm

index 6ca3bbc..bdc1783 100644 (file)
@@ -507,6 +507,14 @@ Class::MOP::Attribute->meta->add_attribute(
     ))
 );
 
+Class::MOP::Attribute->meta->add_attribute(
+    Class::MOP::Attribute->new('insertion_order' => (
+        reader      => { 'insertion_order' => \&Class::MOP::Attribute::insertion_order },
+        writer      => { 'set_insertion_order' => \&Class::MOP::Attribute::set_insertion_order },
+        predicate   => { 'has_insertion_order' => \&Class::MOP::Attribute::has_insertion_order },
+    ))
+);
+
 Class::MOP::Attribute->meta->add_method('clone' => sub {
     my $self  = shift;
     $self->meta->clone_object($self, @_);