From: Yuval Kogman Date: Thu, 21 Aug 2008 10:03:32 +0000 (+0000) Subject: get_all_attributes for MI X-Git-Tag: 0.64_02~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0b5d46da1eaa4f9d54e15c9c809b6de141d483a8;p=gitmo%2FClass-MOP.git get_all_attributes for MI --- diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm index 6da001a..c67945f 100644 --- a/lib/Class/MOP.pm +++ b/lib/Class/MOP.pm @@ -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 }, ), ); diff --git a/lib/Class/MOP/Instance.pm b/lib/Class/MOP/Instance.pm index 75df7ea..749bbc6 100644 --- a/lib/Class/MOP/Instance.pm +++ b/lib/Class/MOP/Instance.pm @@ -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};