bump version to 1.10 so we can dep on it in Moose
[gitmo/Class-MOP.git] / lib / Class / MOP / Mixin / HasAttributes.pm
index 774ac47..c83a876 100644 (file)
@@ -3,7 +3,7 @@ package Class::MOP::Mixin::HasAttributes;
 use strict;
 use warnings;
 
-our $VERSION   = '1.03';
+our $VERSION   = '1.10';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -85,6 +85,18 @@ sub get_attribute_list {
     keys %{ $self->_attribute_map };
 }
 
+sub _restore_metaattributes_from {
+    my $self = shift;
+    my ($old_meta) = @_;
+
+    for my $attr (sort { $a->insertion_order <=> $b->insertion_order }
+                       map { $old_meta->get_attribute($_) }
+                           $old_meta->get_attribute_list) {
+        $attr->_make_compatible_with($self->attribute_metaclass);
+        $self->add_attribute($attr);
+    }
+}
+
 1;
 
 __END__