From: Shawn M Moore Date: Sat, 30 May 2009 22:41:29 +0000 (-0400) Subject: Role->add_conflicted_method X-Git-Tag: 0.80~35 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=09eeab068dd818b643161b16fcdb6247ad8a4b7b;p=gitmo%2FMoose.git Role->add_conflicted_method --- diff --git a/lib/Moose/Meta/Role.pm b/lib/Moose/Meta/Role.pm index 9ea98bd..08f176c 100644 --- a/lib/Moose/Meta/Role.pm +++ b/lib/Moose/Meta/Role.pm @@ -175,6 +175,20 @@ sub add_required_methods { } } +sub add_conflicted_method { + my $self = shift; + + my $method; + if (@_ == 1 && blessed($_[0])) { + $method = shift; + } + else { + $method = $self->conflicted_method_metaclass->new(@_); + } + + $self->add_required_methods($method); +} + ## ------------------------------------------------------------------ ## method modifiers @@ -937,6 +951,11 @@ Adds the named methods to the role's list of required methods. Removes the named methods from the role's list of required methods. +=item B<< $metarole->add_conflicted_method(%params) >> + +Instantiate the parameters as a L +object, then add it to the required method list. + =back =head2 Method modifiers