X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FAction.pm;fp=lib%2FCatalyst%2FAction.pm;h=b01c023286d79cbcd154bbeb555bb73121377d1c;hp=c0e2a43af64e42e28f3b5de954e2e8309a0eea6e;hb=62864794a5688676c4aa0cf0a3bbc9258731fe77;hpb=9d5a273598674257f27213624884890e1f8b1e5a diff --git a/lib/Catalyst/Action.pm b/lib/Catalyst/Action.pm index c0e2a43..b01c023 100644 --- a/lib/Catalyst/Action.pm +++ b/lib/Catalyst/Action.pm @@ -460,6 +460,11 @@ sub compare { return $a1->comparable_arg_number <=> $a2->comparable_arg_number; } +sub equals { + my ($self, $target) = @_; + return $self->private_path eq $target->private_path ? $self : 0; +} + sub scheme { return exists $_[0]->attributes->{Scheme} ? $_[0]->attributes->{Scheme}[0] : undef; } @@ -536,6 +541,12 @@ Tries to find a type constraint if you have on on a type constrained method. Compares 2 actions based on the value of the C attribute, with no C having the highest precedence. +=head2 equal + + if( $action->equal($other_action) ) { ... } + +Returns true if the two actions are equal. + =head2 namespace Returns the private namespace this action lives in.