package Mouse::Meta::Module;
-use Mouse::Util qw/:meta get_code_package get_code_ref load_class not_supported/; # enables strict and warnings
+use Mouse::Util qw/:meta get_code_package get_code_ref not_supported/; # enables strict and warnings
use Carp ();
use Scalar::Util ();
my($self, $method_name) = @_;
if(my $code = $self->get_method_body($method_name)){
- my $method_metaclass = $self->method_metaclass;
- load_class($method_metaclass);
-
- return $method_metaclass->wrap(
+ return Mouse::Util::load_class($self->method_metaclass)->wrap(
body => $code,
name => $method_name,
package => $self->name,
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;
=head1 VERSION
-This document describes Mouse version 0.49
+This document describes Mouse version 0.50_03
=head1 SEE ALSO