X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FModule.pm;h=ec9932ffb8f251538516bb08c76c36812d6e497e;hp=f40c3129c8b45f6fd01f6e6e9634a9bf26df6e7c;hb=013ee5f0c0ce5afa1fea9d45bd14bd8f8bfd67f4;hpb=02bf7ed13ae5d43392767a38fe71e9606f1dba76 diff --git a/lib/Mouse/Meta/Module.pm b/lib/Mouse/Meta/Module.pm index f40c312..ec9932f 100755 --- a/lib/Mouse/Meta/Module.pm +++ b/lib/Mouse/Meta/Module.pm @@ -150,6 +150,37 @@ sub get_method_list { return grep { $self->has_method($_) } keys %{ $self->namespace }; } +sub _collect_methods { # Mouse specific + my($meta, @args) = @_; + + my @methods; + foreach my $arg(@args){ + if(my $type = ref $arg){ + if($type eq 'Regexp'){ + push @methods, grep { $_ =~ $arg } $meta->get_all_method_names; + } + elsif($type eq 'ARRAY'){ + push @methods, @{$arg}; + } + else{ + my $subname = ( caller(1) )[3]; + $meta->throw_error( + sprintf( + 'Methods passed to %s must be provided as a list, ArrayRef or regular expression, not %s', + $subname, + $type, + ) + ); + } + } + else{ + push @methods, $arg; + } + } + return @methods; +} + + { my $ANON_SERIAL = 0; @@ -311,7 +342,7 @@ Mouse::Meta::Module - The base class for Mouse::Meta::Class and Mouse::Meta::Rol =head1 VERSION -This document describes Mouse version 0.48 +This document describes Mouse version 0.50 =head1 SEE ALSO