Implement get_all_method_names
Shawn M Moore [Thu, 5 Feb 2009 21:22:11 +0000 (21:22 +0000)]
Changes
lib/Mouse/Meta/Class.pm

diff --git a/Changes b/Changes
index 5e66bbf..af351aa 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
 Revision history for Mouse
 
 0.16
+    * Implement get_all_method_names
 
 0.15 Thu Feb 5 11:44:05 2009
     * Don't export Mouse's sugar into the package 'main'
index 7f2378d..fbb4bb9 100644 (file)
@@ -88,6 +88,14 @@ sub get_method_list {
     $get_methods_for_class->($self, $self->name);
 }
 
+sub get_all_method_names {
+    my $self = shift;
+    my %uniq;
+    return grep { $uniq{$_}++ == 0 }
+            map { $get_methods_for_class->(undef, $_) }
+            $self->linearized_isa;
+}
+
 sub add_attribute {
     my $self = shift;
     my $attr = shift;