The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

MojoX::Routes::Match - Match

SYNOPSIS

use MojoX::Routes::Match;

my $match = MojoX::Routes::Match->new;

DESCRIPTION

MojoX::Routes::Match is a match container.

ATTRIBUTES

MojoX::Routes::Match implements the following attributes.

captures

my $captures = $match->captures;
$match       = $match->captures({foo => 'bar'});

dictionary

my $dictionary = $match->dictionary;
$match         = $match->dictionary({foo => sub { ... }});

endpoint

my $endpoint = $match->endpoint;
$match       = $match->endpoint(MojoX::Routes->new);

path

my $path = $match->path;
$match   = $match->path('/foo/bar/baz');

root

my $root = $match->root;
$match   = $match->root($routes);

stack

my $stack = $match->stack;
$match    = $match->stack([{foo => 'bar'}]);

tx

my $tx = $match->tx;
$match = $match->tx(Mojo::Transaction::Single->new);

METHODS

MojoX::Routes::Match inherits all methods from Mojo::Base and implements the follwing the ones.

new

my $match = MojoX::Routes::Match->new;
my $match = MojoX::Routes::Match->new(Mojo::Transaction::Single->new);

is_path_empty

my $result = $match->is_path_empty;

url_for

my $url = $match->url_for;
my $url = $match->url_for(foo => 'bar');
my $url = $match->url_for({foo => 'bar'});
my $url = $match->url_for('named');
my $url = $match->url_for('named', foo => 'bar');
my $url = $match->url_for('named', {foo => 'bar'});