X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FMOP.pm;h=ef130fc5083cfd9a712b3ed59ae3799219dcc714;hb=c4260b45e76ce008e4c51987b243f2b0ae4313bb;hp=ed30abfea81e3a0e5f7af6cbb5400236d89e1ee5;hpb=56e8dd5d8cb94bc16d5f663e436aa41178b0dc7d;p=gitmo%2FClass-MOP.git diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm index ed30abf..ef130fc 100644 --- a/lib/Class/MOP.pm +++ b/lib/Class/MOP.pm @@ -13,7 +13,7 @@ use Class::MOP::Method; use Class::MOP::Class::Immutable; -our $VERSION = '0.33'; +our $VERSION = '0.34'; our $AUTHORITY = 'cpan:STEVAN'; { @@ -98,6 +98,7 @@ Class::MOP::Package->meta->add_attribute( # NOTE: # protect this from silliness init_arg => '!............( DO NOT DO THIS )............!', + default => sub { \undef } )) ); @@ -134,6 +135,7 @@ Class::MOP::Module->meta->add_attribute( # NOTE: # protect this from silliness init_arg => '!............( DO NOT DO THIS )............!', + default => sub { \undef } )) ); @@ -154,6 +156,7 @@ Class::MOP::Module->meta->add_attribute( # NOTE: # protect this from silliness init_arg => '!............( DO NOT DO THIS )............!', + default => sub { \undef } )) ); @@ -174,6 +177,33 @@ Class::MOP::Class->meta->add_attribute( ); Class::MOP::Class->meta->add_attribute( + Class::MOP::Attribute->new('%:methods' => ( + reader => { + # NOTE: + # as with the $VERSION and $AUTHORITY above + # sometimes we don't/can't store directly + # inside the instance, so we need the accessor + # to just DWIM + 'get_method_map' => sub { + my $self = shift; + # FIXME: + # there is a faster/better way + # to do this, I am sure :) + return +{ + map { + $_ => $self->get_method($_) + } grep { + $self->has_method($_) + } $self->list_all_package_symbols + }; + } + }, + init_arg => '!............( DO NOT DO THIS )............!', + default => sub { \undef } + )) +); + +Class::MOP::Class->meta->add_attribute( Class::MOP::Attribute->new('$:attribute_metaclass' => ( reader => 'attribute_metaclass', init_arg => ':attribute_metaclass',