Skip to content

Commit

Permalink
the route method is no longer necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 24, 2015
1 parent 618c7b4 commit b3308b1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
14 changes: 0 additions & 14 deletions lib/Mojolicious/Routes.pm
Expand Up @@ -97,10 +97,6 @@ sub match {
"$method:$path:$ws" => {endpoint => $route, stack => $match->stack});
}

sub route {
shift->add_child(Mojolicious::Routes::Route->new(@_))->children->[-1];
}

sub _action { shift->plugins->emit_chain(around_action => @_) }

sub _callback {
Expand Down Expand Up @@ -344,16 +340,6 @@ results for future lookups.
Match routes with L<Mojolicious::Routes::Match>.
=head2 route
my $route = $r->route;
my $route = $r->route('/:action');
my $route = $r->route('/:action', action => qr/\w+/);
my $route = $r->route(format => 0);
Low-level generator for routes matching all HTTP request methods, returns a
L<Mojolicious::Routes::Route> object.
=head1 SEE ALSO
L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicio.us>.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Routes/Route.pm
Expand Up @@ -122,7 +122,7 @@ sub root { shift->_chain->[0] }

sub route {
my $self = shift;
my $route = $self->add_child($self->new(@_))->children->[-1];
my $route = $self->add_child(__PACKAGE__->new(@_))->children->[-1];
my $format = $self->pattern->constraints->{format};
$route->pattern->constraints->{format} //= 0 if defined $format && !$format;
return $route;
Expand Down

0 comments on commit b3308b1

Please sign in to comment.