メモ

一部実装した.

# (o) match
$router->define(sub {
    $_->match( $path, $conditions? )->to( $defaults? );
});

# (o) nested match
$router->define(sub {
    $_->match( $parent_path, $conditions?, sub {
        $_->match( $child_path, $conditions? )->to( $defaults? );
    });
});
# (o) with block (syntactic sugar "to")
$router->define(sub {
    $_->with( $defaults, sub {
        $_->match( $path, $conditions? )->to( $defaults? );
    });
});
# (o) register (syntactic sugar "to")
$router->define(sub {
    $_->match( $path, $conditions? )->register;
});

# (o) find route
my $match = $router->match( $path, $conditions? );
# (o) or find route
my $route = $router->route_for( $path, $conditions? );

# (x) resources
$router->define(sub {
    $_->resources( $name, $params? );
});
# (x) resources with block
$router->define(sub {
    $_->resources( $parent_name, $params?, sub {
        $_->resources( $child_name, $params? );
    });
});