X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction.pm;h=36f4793dec20223cf6430618ce94cca1d65697c1;hb=HEAD;hp=c0e2a43af64e42e28f3b5de954e2e8309a0eea6e;hpb=88e5a8b0c4d28e46b8ba6b6b9567063e57af9063;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Action.pm b/lib/Catalyst/Action.pm index c0e2a43..36f4793 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 equals + + if( $action->equal($other_action) ) { ... } + +Returns true if the two actions are equal. + =head2 namespace Returns the private namespace this action lives in.