Add _get_local_methods method that returns method objects directly.
[gitmo/Class-MOP.git] / lib / Class / MOP / Mixin / HasMethods.pm
index bc5b09c..b8ea9ff 100644 (file)
@@ -156,6 +156,18 @@ sub get_method_list {
         keys %{$namespace};
 }
 
+# This should probably be what get_method_list actually does, instead of just
+# returning names. This was created as a much faster alternative to
+# $meta->get_method($_) for $meta->get_method_list
+sub _get_local_methods {
+    my $self = shift;
+
+    my $namespace = $self->namespace;
+
+    return map { $self->get_method($_) } grep { *{ $namespace->{$_} }{CODE} }
+        keys %{$namespace};
+}
+
 1;
 
 __END__