get_all_attributes for MI
Yuval Kogman [Thu, 21 Aug 2008 10:03:32 +0000 (10:03 +0000)]
lib/Class/MOP.pm
lib/Class/MOP/Instance.pm

index 6da001a..c67945f 100644 (file)
@@ -565,7 +565,7 @@ Class::MOP::Instance->meta->add_attribute(
 
 Class::MOP::Instance->meta->add_attribute(
     Class::MOP::Attribute->new('attributes',
-        reader   => { attributes => \&Class::MOP::Instance::attributes },
+        reader   => { attributes => \&Class::MOP::Instance::get_all_attributes },
     ),
 );
 
index 75df7ea..749bbc6 100644 (file)
@@ -91,6 +91,11 @@ sub get_all_slots {
     return @{$self->{'slots'}};
 }
 
+sub get_all_attributes {
+    my $self = shift;
+    return @{$self->{attributes}};
+}
+
 sub is_valid_slot {
     my ($self, $slot_name) = @_;
     exists $self->{'slot_hash'}->{$slot_name};