package MVC::Neaf::Route::PreRoute;

use strict;
use warnings;
our $VERSION = '0.28';

=head1 NAME

MVC::Neaf::Route::PreRoute - temporary route stub for Not Even A Framework


This is utility class.
Nothing to see here unless one intends to work on L<MVC::Neaf> itself.

It will show up in C<$req-E<gt>route> while a specific route
has not yet been selected.

It can still contain hooks & helpers, that's what it's for.

=head1 METHODS


use Carp;

use parent qw(MVC::Neaf::Route);

=head2 new

'method' parameter is required.


my $nobody_home = sub { die 404 };
sub new {
    my $class = shift;

    # Not using SUPER::new because MVC::Neaf::Route requires a parent
    my $self = bless {
        where   => '[in pre_route]',
        path    => '/',
        code    => $nobody_home,
        default => {},
        hooks   => {},
        helpers => {},
    }, $class;

        if $self->{parent};

    # Probably a bad idea. How to visually separate missing path in logs?
    $self->{path} = '[pre_route]';



=item * method = Actual method;

=item * path = C<'[pre_route]'>

May change to C</> in the future.

=item * code = C<die 404;>

=item * where = C<'[pre_route]'>


Do not rely on these values.



This module is part of L<MVC::Neaf> suite.

Copyright 2016-2019 Konstantin S. Uvarin C<>.

This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.

See L<> for more information.