X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FClass.pm;h=5cf70e17fe5ad14ec503e2a03e8fc92b04942516;hp=661aad06ff3754fd584bd8576df4c47a63de494e;hb=2e92bb89f22acc49ce81b6ec6593d6190559ac45;hpb=4e31595cef06f35cd442a54206f3c1a05c1ac31f diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index 661aad0..5cf70e1 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -63,6 +63,20 @@ sub add_method { *{ $pkg . '::' . $name } = $code; } +# copied from Class::Inspector +sub get_method_list { + my $self = shift; + my $name = $self->name; + + no strict 'refs'; + # Get all the CODE symbol table entries + my @functions = grep !/^meta$/, + grep { /\A[^\W\d]\w*\z/o } + grep { defined &{"${name}::$_"} } + keys %{"${name}::"}; + wantarray ? @functions : \@functions; +} + sub add_attribute { my $self = shift; my $attr = shift;