|
NAMEURI::NamespaceMap::ReservedLocalParts - Permissible local parts for NamespaceMap VERSIONVersion 1.10 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
DESCRIPTIONURI::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. ATTRIBUTESURI::NamespaceMap::ReservedLocalParts implements the following attributes. allowedA 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. disallowedA blacklist of local part names. Does not have a default set, but usually defaults to "uri" when called from URI::NamespaceMap. METHODSURI::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". FURTHER DETAILSSee URI::NamespaceMap for further details about authors, license, etc.
|