URI::N...alParts(3pm)

πŸ“¦
version 1.12 Β· 6 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– URI::NamespaceMap::ReservedLocalParts πŸ’–

okay bestie, so this is URI::NamespaceMap::ReservedLocalParts β€” it's the lil sidekick module that comes with URI::NamespaceMap, and it lives in the User Contributed Perl Documentation, iykyk. Its whole entire job? Telling you which local parts are not allowed. Permissible local parts for NamespaceMap, periodt. ✨

🌸 VERSION 🌸

Version 1.10. yes ma'am. πŸ’…


✨ 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

look at her go 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

So URI::NamespaceMap::ReservedLocalParts is an accompanying distribution to URI::NamespaceMap. Its goal is literally just to check for forbidden names used for local parts. no cap. πŸ”₯

Now here's the clever part, and I'm obsessed: rather than creating a blacklist that needs to be maintained by hand (ugh, the way that would rot πŸ₯€), it instantiates a new Moo object, and calls "can" on the invocant. Using this technique, it means that every method on every Perl object β€” that's "isa", "can", VERSION β€” and Moo objects ("BUILD", "BUILDARGS") will be automatically black listed. automatic. main character energy. πŸ‘‘


πŸŽ€ 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. protecting her peace fr fr 🌸

πŸ’œ disallowed

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


⭐ 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". that's it, that's the whole vibe check βœ…


🌈 FURTHER DETAILS 🌈

See URI::NamespaceMap for further details about authors, license, etc. go read her, she ate πŸ’–


and that's a wrap on the page, bestie β€” this one came out under perl v5.38.2, dated 2024-08-03, straight from the User Contributed Perl Documentation. mwah, love u, bye 🫢✨

πŸ“¦ where this page comes from