1. Toby Inkster
  2. p5-moosex-ersatzmethod

Source

p5-moosex-ersatzmethod / lib / MooseX / ErsatzMethod.pm

Diff from to

File lib/MooseX/ErsatzMethod.pm

 	sub apply_all_ersatz_methods_to_class
 	{
 		my ($self, $class) = @_;
-		$_->apply_to_class($class) for $self->all_ersatz_methods;
+		for ($self->all_ersatz_methods)
+		{
+			next if $self->has_method($_->name);
+			$_->apply_to_class($class);
+		}
 	}
 	sub composition_class_roles
 	{
 =item C<< apply_all_ersatz_methods_to_class($class) >>
 
 Given a Moose::Meta::Class object, iterates through C<all_ersatz_methods>
-applying each to the class.
+applying each to the class. This procedure skips any ersatz method for which
+this role can provide a real method.
 
 =back
 
 
 =back
 
+=head1 CAVEATS
+
+  with 'Role1';  with 'Role2';   # No!
+  with qw( Role1 Role2 );        # Yes
+
 =head1 BUGS
 
 Please report any bugs to