This file is indexed.

/usr/share/perl5/Path/Dispatcher/Path.pm is in libpath-dispatcher-perl 1.05-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package Path::Dispatcher::Path;
use Any::Moose;

use overload q{""} => sub { shift->path };

has path => (
    is        => 'ro',
    isa       => 'Str',
    predicate => 'has_path',
);

has metadata => (
    is        => 'ro',
    isa       => 'HashRef',
    predicate => 'has_metadata',
);

# allow Path::Dispatcher::Path->new($path)
sub BUILDARGS {
    my $self = shift;

    if (@_ == 1 && !ref($_[0])) {
        unshift @_, 'path';
    }

    $self->SUPER::BUILDARGS(@_);
};

sub clone_path {
    my $self = shift;
    my $path = shift;

    return $self->meta->clone_object($self, path => $path, @_);
}

sub get_metadata {
    my $self = shift;
    my $name = shift;

    return $self->metadata->{$name};
}

__PACKAGE__->meta->make_immutable;
no Any::Moose;

1;

__END__

=head1 NAME

Path::Dispatcher::Path - path and some optional metadata

=head1 SYNOPSIS

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

    $path->path;                        # /REST/Ticket/1
    $path->get_metadata("http_method"); # DELETE

=head1 ATTRIBUTES

=head2 path

A string representing the path. C<Path::Dispatcher::Path> is basically a boxed
string. :)

=head2 metadata

A hash representing arbitrary metadata. The L<Path::Dispatcher::Rule::Metadata>
rule is designed to match against members of this hash.

=cut