logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Path::Dispatcher::Rule::Metadata - match path's metadata

Attributes

field
       The metadata field/key name.

   matcher
       A Path::Dispatcher::Rule object for matching against the value of the field.

Author

       Shawn M Moore, "<sartak at bestpractical.com>"

Description

       Rules of this class match the metadata portion of a path.

Name

       Path::Dispatcher::Rule::Metadata - match path's metadata

Support

       Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Path-
       Dispatcher> (or bug-Path-Dispatcher@rt.cpan.org <mailto:bug-Path-Dispatcher@rt.cpan.org>).

Synopsis

           my $path = Path::Dispatcher::Path->new(
               path => '/REST/Ticket'
               metadata => {
                   http_method => 'POST',
               },
           );

           my $rule = Path::Dispatcher::Rule::Metadata->new(
               field   => 'http_method',
               matcher => Path::Dispatcher::Rule::Eq->new(string => 'POST'),
           );

           $rule->run($path);

Version

       version 1.08

See Also