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

URI::NamespaceMap::ReservedLocalParts - Permissible local parts for NamespaceMap

Attributes

       URI::NamespaceMap::ReservedLocalParts implements the following attributes.

   allowed
       A whitelist of local part names. Defaults to "allowed", "disallowed" and "is_reserved" so that when "can"
       is called on the instance, it doesn't return a false positive for other method names associated with this
       package.

   disallowed
       A blacklist of local part names. Does not have a default set, but usually defaults to "uri" when called
       from URI::NamespaceMap.

Description

       URI::NamespaceMap::ReservedLocalParts is an accompanying distribution to URI::NamespaceMap. It's goal is
       to check for forbidden names used for local parts.

       Rather than creating a blacklist that needs to be maintained, it instantiates a new Moo object, and calls
       "can" on the invocant. Using this technique, it means that every method on every Perl object ("isa, can,
       VERSION"), and Moo objects ("BUILD, BUILDARGS") will be automatically black listed.

Further Details

       See URI::NamespaceMap for further details about authors, license, etc.

perl v5.38.2                                       2024-08-03              URI::Namespace...ervedLocalParts(3pm)

Methods

       URI::NamespaceMap::ReservedLocalParts implements the following methods.

   is_reserved
           my $r = URI::NamespaceMap::ReservedLocalParts->new(disallowed => [qw/uri/]);

           say $r->is_reserved('isa'); # 1
           say $r->is_reserved('uri'); # 1
           say $r->is_reserved('foo'); # 0

       Checks if the first argument passed is reserved or not. Returns a "boolean".

Name

       URI::NamespaceMap::ReservedLocalParts - Permissible local parts for NamespaceMap

Synopsis

           my $r = URI::NamespaceMap::ReservedLocalParts->new(disallowed => [qw/uri/]);

           say $r->is_reserved('isa'); # 1
           say $r->is_reserved('uri'); # 1
           say $r->is_reserved('foo'); # 0

Version

       Version 1.10

See Also