X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FMOP%2FClass.pm;h=88842f3abfe556ac577a44abf5a6c5582c54a4a7;hb=c4260b45e76ce008e4c51987b243f2b0ae4313bb;hp=aca8a507231afbbf46f4a4b33e402055e3e2d28d;hpb=56e8dd5d8cb94bc16d5f663e436aa41178b0dc7d;p=gitmo%2FClass-MOP.git diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index aca8a50..88842f3 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -9,7 +9,7 @@ use Scalar::Util 'blessed', 'reftype', 'weaken'; use Sub::Name 'subname'; use B 'svref_2object'; -our $VERSION = '0.18'; +our $VERSION = '0.19'; our $AUTHORITY = 'cpan:STEVAN'; use base 'Class::MOP::Module'; @@ -77,12 +77,23 @@ sub construct_class_instance { $meta = bless { # inherited from Class::MOP::Package '$:package' => $package_name, - '%:namespace' => \%{$package_name . '::'}, + + # NOTE: + # since the following attributes will + # actually be loaded from the symbol + # table, and actually bypass the instance + # entirely, we can just leave these things + # listed here for reference, because they + # should not actually have a value associated + # with the slot. + '%:namespace' => \undef, # inherited from Class::MOP::Module - '$:version' => (exists ${$package_name . '::'}{'VERSION'} ? ${$package_name . '::VERSION'} : undef), - '$:authority' => (exists ${$package_name . '::'}{'AUTHORITY'} ? ${$package_name . '::AUTHORITY'} : undef), - # defined here ... - '%:attributes' => {}, + '$:version' => \undef, + '$:authority' => \undef, + # defined in Class::MOP::Class + '%:methods' => \undef, + + '%:attributes' => {}, '$:attribute_metaclass' => $options{':attribute_metaclass'} || 'Class::MOP::Attribute', '$:method_metaclass' => $options{':method_metaclass'} || 'Class::MOP::Method', '$:instance_metaclass' => $options{':instance_metaclass'} || 'Class::MOP::Instance', @@ -238,6 +249,20 @@ sub attribute_metaclass { $_[0]->{'$:attribute_metaclass'} } sub method_metaclass { $_[0]->{'$:method_metaclass'} } sub instance_metaclass { $_[0]->{'$:instance_metaclass'} } +sub get_method_map { + 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 + }; +} + # Instance Construction & Cloning sub new_object { @@ -891,6 +916,8 @@ what B does, but we don't remove duplicate names. =over 4 +=item B + =item B =item B